How do I start a process from C#?

后端 未结 12 2031
北荒
北荒 2020-11-22 03:38

How do I start a process, such as launching a URL when the user clicks a button?

12条回答
  •  遇见更好的自我
    2020-11-22 03:49

    Just as Matt says, use Process.Start.

    You can pass a URL, or a document. They will be started by the registered application.

    Example:

    Process.Start("Test.Txt");
    

    This will start Notepad.exe with Text.Txt loaded.

提交回复
热议问题