main函数的参数
public class app
{
[STAThread] //Gao 指示应用程序的 COM 线程模型是单线程单元,,对应的是[MTAThread] (多线程单元线程)
static void Main(string[] args)
{
//使用args
}
}
是怎么传给main参数?没写过
[解决办法]
命令行
[解决办法]
static void Main(string[] args) { //使用args if(args.Length > 0) { Console.WriteLine(args[0]); } Console.ReadKey();}
[解决办法]
xx.exe -a -b -c -d
依据空格分割成字符串数组传入 args 里