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博客

相关推荐
晨星shine3 天前
GC、Dispose、Unmanaged Resource 和 Managed Resource
后端·c#
用户298698530144 天前
.NET 文档自动化:Spire.Doc 设置奇偶页页眉/页脚的最佳实践
后端·c#·.net
用户3667462526744 天前
接口文档汇总 - 2.设备状态管理
c#
用户3667462526744 天前
接口文档汇总 - 3.PLC通信管理
c#
Ray Liang5 天前
用六边形架构与整洁架构对比是伪命题?
java·python·c#·架构设计
Scout-leaf8 天前
WPF新手村教程(三)—— 路由事件
c#·wpf
用户298698530148 天前
程序员效率工具:Spire.Doc如何助你一键搞定Word表格排版
后端·c#·.net
mudtools9 天前
搭建一套.net下能落地的飞书考勤系统
后端·c#·.net
玩泥巴的9 天前
搭建一套.net下能落地的飞书考勤系统
c#·.net·二次开发·飞书
唐宋元明清21889 天前
.NET 本地Db数据库-技术方案选型
windows·c#