c#函數中 static void Main(String[ ] args )括號中的參數作用?
1 回答

暮色呼如
TA貢獻1853條經驗 獲得超9個贊
額 這個就是接受參數的意思。我們知道,在程序里面調用外部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 回答
- 0 關注
- 704 瀏覽
添加回答
舉報
0/150
提交
取消