怎样通过一个button的单击事件执行其它应用程序。如setup.exe!!!!!!!!!!!再线等待!!!!!!!!!!!!!!!!!!!!!!!马上给分
最好能有例子!!!!!!!!!!!谢谢
using System.Diagnostics;
click事件中写入:
System.Diagnostics.Process.Start("xxxx.exe")
例:
Process.Start("net.exe","send 128.128.7.22 kkk");
System.Diagnostics.Process.Start("cmd.exe","/c dir");
注:/c参数是执行完参数关闭窗口
using System.Diagnostics;
System.Diagnostics.Process.Start("xxxxx.exe");
System.Diagnostics.Process.Start("cmd.exe","dir");
Process.Start("net.exe","send 128.128.7.22 kkk");
System.Diagnostics.Process.Start("cmd.exe","/c dir");
运行cmd.exe时需要加上/c参数, 让它运行结束后关闭
其它程序也是这样两种参数, 一个是运行的程序路径名, 一个是程序运行所给的参数
using System.Diagnostics;
…………
Process.Start("hello.exe");
Process.Start("notepad.exe");
Process.Start(@"完整路徑");
System.Diagnostics.Process.Start("文件名");
任何可执行文件都可以运行
up,如果你要做安装程序的话,还是用installshield或者是.net自带的工具吧
至于你说的功能,就用调用命令行命令就可完成了,如楼上的星星们所说
上面的兄弟说的对,用:Process.Start()吧