博客
关于我
c#启动本机程序
阅读量:659 次
发布时间:2019-03-16

本文共 414 字,大约阅读时间需要 1 分钟。

  写一段简单的程序启动本机上的程序,千千静听,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();

        }

    }

}

转载地址:http://isdqz.baihongyu.com/

你可能感兴趣的文章
linux中提示The requested URL *** was not found on this server
查看>>
自定义Seekbar样式
查看>>
if elseif elseif else结构和switch case结构的逻辑表达以及语法使用区别
查看>>
Hidden treasures of the Rust ecosystem
查看>>
Baryshnikov: Improving Web App with Rust and WebAssembly
查看>>
【Rust投稿】从零实现消息中间件(6)-CLIENT
查看>>
Rust异步浅谈
查看>>
【Rust每周一库】sled - 嵌入式数据库
查看>>
【Rust日报】2020-08-01 用 Rust 重写的一系列命令行工具
查看>>
【Rust 日报】2020-12-05 rust-gpu 发布 v0.2
查看>>
man工具
查看>>
FoxMail 查看邮件乱码
查看>>
【网络加速】TensorRT7-开发指南中文_Plus版【1】
查看>>
SaltStack about The Top File 使用知识介绍
查看>>
SaltStack的多云管理解决方案——使用Salt Cloud集成管理腾讯云平台
查看>>
AttributeError: ‘list‘ object has no attribute ‘astype‘
查看>>