/// <summary>
/// 执行cmd.exe程序
/// </summary>
/// <param name="command">命令</param>
/// <returns>结果</returns>
public static string ExecuteCmd(string command)
{
string result = string.Empty;
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(command);
p.StandardInput.WriteLine("exit");
result = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
return result;
}