void Main()
{
    var ip = "192.168.0.x";
    var username = "administrator";
    var password = "123456";
    
    Process rdcProcess = new Process();
    rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\cmdkey.exe");
    rdcProcess.StartInfo.Arguments = string.Format( "/generic:TERMSRV/{0} /user:{1} /pass:{2}",ip,username,password);
    rdcProcess.Start();
    rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\mstsc.exe");
    rdcProcess.StartInfo.Arguments = "/v " + ip; // ip or name of computer to connect
    rdcProcess.Start();
}

 

相关文章:

  • 2021-12-25
  • 2021-08-10
  • 2022-12-23
  • 2021-07-05
  • 2021-11-03
  • 2021-04-01
  • 2022-12-23
  • 2021-10-10
猜你喜欢
  • 2021-12-11
  • 2021-12-19
  • 2022-01-21
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
相关资源
相似解决方案