• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
敬YES
Now Or Never
博客园    首页       联系   管理    订阅  订阅
c#启动本机程序
  写一段简单的程序启动本机上的程序,千千静听,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();

        }

    }

}

作者:陈敬(公众号:敬YES)
出处:http://www.cnblogs.com/janes/
博客文章仅供交流学习,请勿用于商业用途。如需转载,请务必注明出处。

posted on 2008-07-23 15:30  敬YES  阅读(604)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3