Execute CMD command from code

后端 未结 10 1173
故里飘歌
故里飘歌 2020-11-30 06:38

In C# WPF: I want to execute a CMD command, how exactly can I execute a cmd command programmatically?

10条回答
  •  死守一世寂寞
    2020-11-30 07:19

    Using Process.Start:

    using System.Diagnostics;
    
    class Program
    {
        static void Main()
        {
            Process.Start("example.txt");
        }
    }
    

提交回复
热议问题