摘要: c#中的Process类可方便的调用外部程序,所以我们可以通过调用cmd.exe程序加入参数 "/c " + 要执行的命令来执行一个dos命令(/c代表执行参数指定的命令后关闭cmd.exe /k参数则不关闭cmd.exe)Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; p.StartInfo.Arguments = "/k shutdown -a"; p.StartInfo.UseShellExecute = false; p.StartInfo.Redire 阅读全文
posted @ 2012-07-03 15:06 贺俊峰 阅读(298) 评论(0) 推荐(0) 编辑