在.net平台下,执行命令行
2007-05-14 14:03 ruinet 阅读(413) 评论(0) 收藏 举报
//---格式一
System.Diagnostics.Process.Start("CMD.exe", "/c net send 10.116.193.89 你好!");
// System.Diagnostics.Process.Start("cmd.exe","/c ipconfig");
//---格式二
Process MyProcess = new Process();
MyProcess.StartInfo.FileName = "CMD.exe";
MyProcess .StartInfo.CreateNoWindow =true ;
MyProcess.StartInfo.Arguments = "/c ipconfig";
MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;//使窗体不显示出来
MyProcess.Start();
//----格式三
System.Diagnostics.Process.Start("IExplore.exe", "D:");
System.Diagnostics.Process.Start("IExplore.exe", "www.baidu.com");
浙公网安备 33010602011771号