日期:2014-05-17 浏览次数:21156 次
ClientDS.esClient_ServerManageRow _row = row as ClientDS.esClient_ServerManageRow;
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string strOutput = string.Format("mstsc /v:{0} /admin", _row.fldIp);
p.StandardInput.WriteLine(strOutput);
p.StandardInput.WriteLine("exit");
while (p.StandardOutput.EndOfStream)
{
strOutput = p.StandardOutput.ReadLine();
}
p.WaitForExit();
p.Close();