c# 代码执行远程连接命令怎么将账号密码传入
c# 代码执行远程连接命令如何将账号密码传入
数据库中存有客户服务器IP地址 登录名 登陆密码 如何进行远程登陆
点击图片中的“登陆”按钮 自动登入客户服务器
下面是自己的部分代码
------解决方案--------------------
何必要用CMD来执行呢,C#可以集成远程桌面的控件的,到Codeproject上找找
数据库中存有客户服务器IP地址 登录名 登陆密码 如何进行远程登陆
点击图片中的“登陆”按钮 自动登入客户服务器
下面是自己的部分代码
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();
c#
远程连接
------解决方案--------------------
何必要用CMD来执行呢,C#可以集成远程桌面的控件的,到Codeproject上找找