How do I start a process from C#?

后端 未结 12 2222
北荒
北荒 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 04:08

    To start Microsoft Word for example, use this code:

    private void button1_Click(object sender, EventArgs e)
    {
        string ProgramName = "winword.exe";
        Process.Start(ProgramName);
    }
    

    For more explanations, check out this link.

提交回复
热议问题