没有c#中的用户名/密码窗口如何连接到远程桌面 [英] how to connect to remote desktop without the username/password window in c#

查看:63
本文介绍了没有c#中的用户名/密码窗口如何连接到远程桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i想要在没有用户名窗口的情况下连接到远程桌面。

我已经尝试了

cmdkey /generic:172.21.55.185 / user:username/ pass:password

mstsc /v:172.21.55.185



此方法仍然会提示连接窗口,然后是安全证书窗口。有没有办法可以直接进入远程机器的桌面?

Hi,

i want to connect to the remote desktop without the username window.
Already i ve tried
cmdkey /generic:172.21.55.185 /user:"username" /pass:"password"
mstsc /v:172.21.55.185

This method still prompts connect window and then security certificate window. is there a way by which i can directly move into the desktop of the remote machine ?

推荐答案

问题是你在两个不同的进程中运行这些命令(甚至你使用相同的对象运行开始两次)所以用户名和密码对RDP命令没有影响...

(实际上不支持重用过程对象,可能会有意想不到的结果)。 ..

所以你必须在一次调用中运行它...

您可以使用cmd.exe的/ c命令行选项,如下所示:

The problem is that you are running those commands in two different processes (even you use the same object you run Start twice) so the username and password has no effect on the RDP command...
(Actually reuse of the process object is not supported and may have unexpected results)...
So you have to run it in a single call...
You may use the /c command line options of cmd.exe like this:
String szCmd = "/c cmdkey.exe /generic:ip /user:username /pass:password & mstsc.exe /v ip";
ProcessStartInfo info = new ProcessStartInfo("cmd.exe", szCmd);
Process proc = new Process();
proc.StartInfo = info;
proc.Start();


我通过禁用两个窗口来解决这个问题。



http://weblogs.asp.net/owscott/Vista_2700_s-Remote-Desktop-Prompt [ ^ ]



谢谢
I solved this by disabling both the windows.

http://weblogs.asp.net/owscott/Vista_2700_s-Remote-Desktop-Prompt[^]

Thank you


这篇关于没有c#中的用户名/密码窗口如何连接到远程桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆