using System.Diagnostics;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参数是执行完参数关闭窗口
例:
Process.Start("net.exe","send 128.128.7.22 kkk");
System.Diagnostics.Process.Start("cmd.exe","/c dir");
注:/c参数是执行完参数关闭窗口
System.Diagnostics.Process.Start("x.exe");
//x.exe文件在当前目录.
如要制定目录,则同上
process1.FileName = xxx.exe;
process1.Start;
ps.StartInfo.FileName = @"F:\OYAMA\OYAMA.GUI\bin\Debug\OYAMA.exe";
ps.Start();
谢谢
long Function ShellExecute(
long hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
long nShowCmd);ShellExecute(handle, NULL, <fully_qualified_path_to_folder>, NULL, NULL, SW_SHOWNORMAL);
ShellExcute的使用方法可以参考msdn:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/shellcc/platform/shell/reference/functions/shellexecute.htm
添加引用:
using System.Diagnostics;
实现:
Process.Start("myfile.exe");
2.打开帮助文件:
添加引用:
using System.IO;
定义:
private const string helpFile="D:\\newProgram\\OpenHelpFile\\csharp.chm";
实现:
FileInfo fi = new FileInfo(helpFile);
Help.ShowHelp(this, helpFile);