代码改变世界

随笔档案-2012年8月20日

C# 执行DOS命令方法记录

2012-08-20 23:23 by Andrew.Wangxu, 453 阅读, 收藏,
摘要: /// /// 执行DOS命令,返回DOS命令的输出 /// /// dos命令 /// 等待命令执行的时间(单位:毫秒),如果设定为0,则无限等待 /// 返回DOS命令的输出 public static string ExecuteDOS(string dosCommand, int seconds) { string output = ""; //输出字符串 if (dosCommand != null && dosC... 阅读全文