Main function

简介:    static int Main(string[] args)          {          …            string[] the Args=Environment.

 

 static int Main(string[] args)

         {

        

           string[] the Args=Environment.GetCommandLineArgs();

           foreach(string arg in theArgs)

               Console.WriteLIne("Arg:{0}",arg);

           Console.ReadLine();

           return -1;

         }

         static void ShowEnvironmentDetails()

        {

            foreach (string drive in Environment.GetLogicalDrives())

                Console.WriteLine("Drive:{0}",drive);

            Console.WriteLine("OS:{0}",Environment.OSVersion);

            Console.WriteLine("Number of processors:{0}",Environment.ProcessorCount);

            Console.WriteLine(".NET Version: {0}",Environment.Version);

        }

        static void ChangeConsoleColor()

        {

            ConsoleColor prevColor = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Red;

            ShowEnvironmentDetails();

            Console.ForegroundColor = prevColor;

            Console.WriteLine("{1},{0},{2}",10,20,30);

        }

        static void FormatNumericalData()

        {

            Console.WriteLine("The value 9999 in various formats:");

            Console.WriteLine("c format:{0:c}",9999);

            Console.WriteLine("d9 format:{0:d9}", 9999);

            Console.WriteLine("f3 format:{0:f3}", 9999);

            Console.WriteLine("n format:{0:n}", 9999);

            Console.WriteLine("E format:{0:E}", 9999);

            Console.WriteLine("e format:{0:e}", 9999);

            Console.WriteLine("X format:{0:X}", 9999);

            Console.WriteLine("x format:{0:x}", 9999);

        }

目录
打赏
0
0
0
0
20
分享
相关文章
|
10月前
|
Go
Error: Package awesomeProject contains more than one main function Consider using File kind instead
Goland编辑器运行时出现“edit configuration”窗口,阻碍代码执行。解决方法:右键点击源文件运行。问题源于Go语言不支持函数重载,同一包内不能有两个同名函数,导致多入口冲突。初学者在main包中使用了多个Go源文件,应改为仅有一个源码文件来避免此问题。
87 0
1:Unit test and main function-Java API 实战
1:Unit test and main function-Java API 实战
114 0
1:Unit test and main function-Java API 实战
【Azure Function】FTP上传了Python Function文件后,无法在门户页面加载函数的问题
通过FTP上传Python Function至Azure云后,出现函数列表无法加载的问题。经排查,发现是由于`requirements.txt`中的依赖包未被正确安装。解决方法为:在本地安装依赖包到`.python_packages/lib/site-packages`目录,再将该目录内容上传至云上的`wwwroot`目录,并重启应用。最终成功加载函数列表。
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新特性,与传统函数相比,它有更简洁的语法,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。箭头函数不适用于构造函数,不能使用new关键字调用。
详解Wireshark LUA插件函数:function p_myproto.dissector(buffer, pinfo, tree)
在 Wireshark 中,LUA 插件通过 `function p_myproto.dissector(buffer, pinfo, tree)` 扩展协议解析能力,解析自定义应用层协议。参数 `buffer` 是 `PacketBuffer` 类型,表示原始数据包内容;`pinfo` 是 `ProtoInfo` 类型,包含数据包元信息(如 IP 地址、协议类型等);`tree` 是
199 1
箭头函数与普通函数(function)的区别
箭头函数是ES6引入的新语法,相比传统函数表达式更简洁,且没有自己的this、arguments、super或new.target绑定,而是继承自外层作用域。这使得箭头函数在处理回调和闭包时更加灵活方便。
|
5月前
|
函数对象包装器function和bind机制
函数对象包装器function和bind机制
35 0
|
7月前
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
【Azure Durable Function】PowerShell Activity 函数遇见 Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded.
【Azure Function App】如何修改Azure函数应用的默认页面呢?
【Azure Function App】如何修改Azure函数应用的默认页面呢?
【Azure 应用服务】Azure Durable Function(持久函数)在执行Activity Function时候,因为调用函数名称错误而导致长时间无响应问题
【Azure 应用服务】Azure Durable Function(持久函数)在执行Activity Function时候,因为调用函数名称错误而导致长时间无响应问题

热门文章

最新文章