What is “string[] args” in Main class for?

后端 未结 8 1520
眼角桃花
眼角桃花 2020-12-13 01:37

In C# the Main class has string[] args parameter.

What is that for and where does it get used?

8条回答
  •  长情又很酷
    2020-12-13 02:04

    This is an array of the command line switches pass to the program. E.g. if you start the program with the command "myapp.exe -c -d" then string[] args[] will contain the strings "-c" and "-d".

提交回复
热议问题