找到34423篇关于编程的文章

如何在C#中更改控制台的CursorSize?

AmitDiwan
更新于2019年11月13日 07:01:33

161次浏览

要在C#中更改控制台的CursorSize,请使用C#中的Console.CursorSize属性。示例让我们来看一个例子:using System; class Demo {    public static void Main (string[] args) {       Console.BackgroundColor = ConsoleColor.Blue;       Console.WriteLine("背景颜色已更改 = "+Console.BackgroundColor);       Console.ForegroundColor = ConsoleColor.Yellow;       Console.WriteLine("前景色已更改 = "+Console.ForegroundColor);       Console.CursorSize = 1;       Console.WriteLine("CursorSize = "+Console.CursorSize);    } }输出这将产生以下输出:

如何在C#中更改控制台的CursorLeft?

AmitDiwan
更新于2019年11月13日 07:00:13

254次浏览

要在C#中更改控制台的CursorLeft,请使用Console.CursorLeft属性。示例让我们来看一个例子:using System; class Demo {    public static void Main (string[] args) {       Console.BackgroundColor = ConsoleColor.Blue;       Console.WriteLine("背景颜色已更改 = "+Console.BackgroundColor);       Console.ForegroundColor = ConsoleColor.Yellow;       Console.WriteLine("前景色已更改 = "+Console.ForegroundColor);       Console.CursorLeft = 30;       Console.Write("CursorLeft位置: "+Console.CursorLeft);    } }输出这将产生以下输出:

如何在C#控制台中更改文本的前景色?

AmitDiwan
更新于2019年11月13日 06:58:27

9K+ 次浏览

要更改文本的前景色,请在C#中使用Console.ForegroundColor属性。示例让我们来看一个例子:using System; class Demo {    public static void Main (string[] args) {       Console.BackgroundColor = ConsoleColor.Blue;       Console.WriteLine("背景颜色已更改 = "+Console.BackgroundColor);       Console.ForegroundColor = ConsoleColor.Yellow;       Console.WriteLine("前景色已更改 = "+Console.ForegroundColor);    } }输出这将产生以下输出:

如何在C#中更改控制台的BufferWidth?

AmitDiwan
更新于2019年11月13日 06:56:55

133次浏览

要更改控制台的BufferWidth,请使用Console.BufferWidth属性。示例现在让我们来看一个例子:using System; class Demo {    public static void Main (string[] args){       Console.BufferHeight = 200;       Console.WriteLine("缓冲区高度 = "+Console.BufferHeight);       Console.BufferHeight = 250;       Console.WriteLine("缓冲区宽度 = "+Console.BufferWidth);    } }输出这将产生以下输出:缓冲区高度 = 200 缓冲区宽度 = 200

C#中的Char.IsLetter()方法

AmitDiwan
更新于2019年11月13日 06:54:36

2K+ 次浏览

C#中的Char.IsLetter()方法用于指示指定的Unicode字符是否被归类为Unicode字母。语法以下是语法:public static bool IsLetter (char ch);上面,参数ch是要评估的Unicode字符。示例现在让我们来看一个实现Char.IsLetter()方法的例子:using System; public class Demo {    public static void Main(){       bool res;       char val = 'K';       Console.WriteLine("值 = "+val);       res = Char.IsLetter(val);       Console.WriteLine("值是字母吗? = "+res);    } }输出这将产生以下…阅读更多

C#中的Char.IsHighSurrogate(String, Int32)方法

AmitDiwan
更新于2019年11月13日 06:52:59

115次浏览

C#中的Char.IsHighSurrogate()方法指示字符串中指定位置的Char对象是否为高代理项。语法以下是语法:public static bool IsHighSurrogate (string str, int index);上面,str是字符串,而index是要在str中评估的字符的位置。示例现在让我们来看一个实现Char.IsHighSurrogate()方法的例子:using System; public class Demo {    public static void Main(){       string str = new String(new char[] { 'k', 'm', 'g', 't', '\uD800' });       bool res = Char.IsHighSurrogate(str, 4);       if (res)  …阅读更多

C#中的Char.IsDigit()方法

AmitDiwan
更新于2019年11月13日 06:51:02

2K+ 次浏览

C#中的Char.IsDigit()方法指示指定的Unicode字符是否被归类为十进制数字。语法以下是语法:public static bool IsDigit (char ch);上面,参数ch是要评估的Unicode字符。示例现在让我们来看一个实现Char.IsDigit()方法的例子:using System; public class Demo {    public static void Main(){       bool res;       char val = 'g';       Console.WriteLine("值 = "+val);       res = Char.IsDigit(val);       Console.WriteLine("值是数字吗? = "+res);    } }输出这将产生以下输出:值 =…阅读更多

C#中的MathF.Atan()方法及示例

AmitDiwan
更新于2019年11月13日 06:49:46

59次浏览

C#中的MathF.Atan()方法用于返回正切值为浮点型值参数的角度。语法以下是语法:public static float Atan (float val);上面,Val是浮点值。示例现在让我们来看一个实现MathF.Atan()方法的例子:using System; public class Demo {    public static void Main(){       float val1 = 1.2f;       float val2 = 45.5f;       Console.WriteLine("角度 (val1) = "+(MathF.Atan(val1)));       Console.WriteLine("角度 (val2) = "+(MathF.Atan(val2)));    } }输出这将产生以下输出:角度 (val1) = 0.876058 角度 (val2) = 1.548822示例让我们…阅读更多

C#中的MathF.Asinh()方法及示例

AmitDiwan
更新于2019年11月13日 06:47:08

69次浏览

C#中的MathF.Asinh()方法用于返回浮点值的双曲反正弦。语法以下是语法:public static float Asinh (float val);示例现在让我们来看一个实现MathF.Asinh()方法的例子:using System; public class Demo {    public static void Main(){       float val1 = 1.2f;       float val2 = 45.5f;       Console.WriteLine("角度 (val1) = "+(MathF.Asinh(val1)));       Console.WriteLine("角度 (val2) = "+(MathF.Asinh(val2)));    } }输出这将产生以下输出:角度 (val1) = 1.015973 角度 (val2) = 4.51098示例让我们现在来看另一个实现MathF.Asinh()方法的例子…阅读更多

C#中的MathF.Asin()方法及示例

AmitDiwan
更新于2019年11月13日 06:44:07

56次浏览

C#中的MathF.Asin()方法用于返回正弦值为浮点型值参数的角度。语法以下是语法:public static float Asin (float val);上面,Val是浮点值。示例现在让我们来看一个实现MathF.Asin()方法的例子:using System; public class Demo {    public static void Main(){       float val1 = 0.1f;       float val2 = 8.9f;       Console.WriteLine("角度 (val1) = "+(MathF.Asin(val1)));       Console.WriteLine("角度 (val2) = "+(MathF.Asin(val2)));    } }输出这将产生以下输出:角度 (val1) = 0.1001674 角度 (val2) = NaN示例让我们现在来看…阅读更多

广告
© . All rights reserved.