如何在VB中使用远程桌面连接 [英] How to use remote desktop connection in VB

查看:737
本文介绍了如何在VB中使用远程桌面连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我一直在尝试制作3年以上的远程桌面程序,并希望能够立即实现。我最终从rdpencom.dll找到了RDPViewer类,但是每次运行程序只允许一个连接,所以你不能断开连接并重新连接,因为它说:



由于以下错误,从IClassFactory创建具有CLSID {9B78F0E6-3E05-4A5B-B2E8-E743A8956B65}的COM组件实例失败:800700b7当该文件已存在时无法创建文件。 (HRESULT的例外情况:0x800700B7)。



所以我放弃了,并尝试使用mstscax的微软终端服务客户端控件(我命名为rdp)。 DLL,但不会连接。我正在使用以下代码:





Hi,

I've been trying to make a remote desktop program for 3+ years and just want to be able to do it now. I eventually found the RDPViewer class from rdpencom.dll but that only allows one connection for each run of the program, so you can't just disconnect and reconnect because it says:

Creating an instance of the COM component with CLSID {9B78F0E6-3E05-4A5B-B2E8-E743A8956B65} from the IClassFactory failed due to the following error: 800700b7 Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7).

So I gave up with that and tried using the microsoft terminal services client control (which I named "rdp") from mstscax.dll, but that won't connect. I'm using the following code for it:


rdp.Server = "Rixterz-PC" 'This computer's name
rdp.Domain = "WORKGROUP" 'The workgroup my laptop is in
rdp.UserName = "Owner" 'Owner is the username for Windows 7
Dim secured As IMsTscNonScriptable = DirectCast(rdp.GetOcx(), IMsTscNonScriptable)
secured.ClearTextPassword = "This computer's password"
rdp.Connect()





我试图在我的电脑上运行它(程序的两端)虽然没有错误,但没有屏幕显示无论是。点击连接按钮后,就是这样。没什么。



我做错了什么?我使用Ammyy Admin获取灵感,并且可以做到。



I tried to run this on my pc (both ends of the program) and although there were no errors, there was no screen showing up either. Once the connect button was clicked, that was it. Nothing.

What am I doing wrong? I used Ammyy Admin for inspiration and that can do it.

推荐答案

这篇关于如何在VB中使用远程桌面连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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