C#连接远程windows桌面
/// <summary>
/// 连接远程windows桌面
/// </summary>
/// <param name="ip"></param>
private void ConnectRemotely(string ip)
{
string command = "mstsc /v: "+ip+" /console";
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c"+command;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
}
浙公网安备 33010602011771号