C# 启动exe 程序

(1) publicbool Start ()

cs 复制代码
System.Diagnostics.Process process = new System.Diagnostics.Process(); 
process.StartInfo.FileName = "iexplore.exe";   //IE浏览器,可以更换 
process.StartInfo.Arguments = "http://www.baidu.com"; 
process.Start();

(2) publicstaticProcessStart (ProcessStartInfostartInfo)

cs 复制代码
System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo(); 
processStartInfo.FileName = "explorer.exe";  //资源管理器 
processStartInfo.Arguments = @"D:\"; 
System.Diagnostics.Process.Start(processStartInfo);

(3) publicstaticProcessStart (stringfileName)

cs 复制代码
System.Diagnostics.Process.Start(@"D:\Program Files\Tencent\QQ\Bin\QQ.exe");  //直接调用打开文件

(4) Process.Start (StringfileName, Stringarguments)

cs 复制代码
System.Diagnostics.Process.Start("explorer.exe", "D:\\Readme.txt");   //直接打开文件Readme.txt 

上面已经举例了用process.start()打开网站的方法,现在讲讲用processs.star()定位到某个文件的方法。

C# Process.Start()方法详解 调用其他exe 程序_c# process调用一个方法-CSDN博客

相关推荐
谙弆悕博士20 小时前
Lua学习笔记
c语言·开发语言·笔记·学习·lua·创业创新·业界资讯
Data_Journal20 小时前
2026年十大数据集网站
大数据·开发语言·数据库·人工智能·python
cui_ruicheng20 小时前
Linux线程(三):线程同步、互斥与生产者消费者模型
linux·服务器·开发语言
CryptoPP20 小时前
解锁股票数据可视化新姿势:轻量级数据接口与动态图表实践
大数据·开发语言·人工智能·信息可视化·金融·区块链
cui_ruicheng20 小时前
Linux线程(二):pthread 线程库与线程控制
java·开发语言·jvm
MATLAB代码顾问20 小时前
【智能优化】杜鹃搜索算法(CSA)原理与Python实现
开发语言·python
AIFQuant21 小时前
贵金属 API 避坑:黄金/白银行情接口常见陷阱(数据漂移、断点、延迟)
开发语言·python·websocket·金融·restful·贵金属
加号321 小时前
【C#】 HTTP 请求通讯实现指南
开发语言·http·c#
平安的平安21 小时前
Python实现RAG检索增强生成:让大模型拥有你的私有知识库
开发语言·python