写一段简单的程序启动本机上的程序,千千静听,IE或者计算器。觉得挺有意思的。初学,和大家分享一下。我是使用的控制台应用程序

首先添加命名空间:

using System.Diagnostics;

 

namespace 控制台

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("please input :1-千千静听,2-IE,3-计算器");

            int cmd = Console.Read();

            if (cmd == 49)

                Process.Start("TTPlayer.exe");

            else if (cmd == 50)

                Process.Start("IEXPLORE.EXE");

            else if (cmd == 51 )

                Process.Start("Calc.exe");

            Console.ReadLine();

        }

    }

}

相关文章:

  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2021-11-23
  • 2021-09-29
  • 2021-12-03
  • 2021-08-18
  • 2022-02-26
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-10-01
  • 2021-06-24
相关资源
相似解决方案