C# - Arguments for application

后端 未结 5 461
野趣味
野趣味 2021-01-27 08:02

How can I make it so when there are arguments added to the end of the program name it does a specific method or whatever?

Also, is there a name for this?

Example

5条回答
  •  难免孤独
    2021-01-27 09:00

    Command line arguments.

    On c# you can find them on

    static void Main(string[] args)
    

    Or from anywhere using

    Environment.GetCommandLineArgs()
    

提交回复
热议问题