c#函数中 static void Main(String[ ] args )括号中的参数作用?

如题所述

额 这个就是接受参数的意思。我们知道,在程序里面调用外部exe文件时,后面可以加参数。那么这个参数的格式就取决于你这个括号里面参数的格式。比如有一个 text.exe,程序入口这样写:static void Main(String args)那么调用这个程序就可以 Process proc = new Process(); proc.StartInfo.FileName = @"text";proc.StartInfo.Arguments = "参数“;字符串static void Main(String[] args)那么调用这个程序就可以 Process proc = new Process(); proc.StartInfo.FileName = @"text";proc.StartInfo.Arguments = "{”1“,”2“}“;数组static void Main(int args)那么调用这个程序就可以 Process proc = new Process(); proc.StartInfo.FileName = @"text";proc.StartInfo.Arguments = 1;整形
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-02-25
可以要,可以不要,因为那是个默认的数组
相似回答