tags:

views:

157

answers:

2

I want to connect to a remote desktop connection to a specified server/username from c#.

I have found: __http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx a AxMSTSCLib dll should be referenced to the solution. I don't want to download this dll from anywhere as I'm not sure if I can trust it.

However it also says: "After research on the web I found that I have to create new AxMSTSCLib and MSTSCLib DLLs. So I did"

How do I "create" this new AxMSTSCLib ?

Other link, doesn't use this dll but run an script instead. http://bytes.com/topic/c-sharp/answers/517024-remote-desktop-connection-c but that code throws Security Exception. So I cannot use it.

+1  A: 

Here is a link with the information you'll need: http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx

riffnl
My bad. I wanted to write this post in my above post. (now edited).That's a geart article, but the problem remains.After I have downloaded that guy's code project I see he reference a AxMSTSCLib dll (which you have to create manually for your pc).I have tried to create my own AxMSTSCLib dll following this link:http://bytes.com/topic/c-sharp/answers/684780-axmstsclib-axmstscax-known-issueThe problem is that the dll differs from wahat actually needed (see my thread below)
I have tried to create my own AxMSTSCLib dll following this link:http://bytes.com/topic/c-sharp/answers/684780-axmstsclib-axmstscax-known-issueThe problem is that the dll differs from wahat actually needed (see my thread below)As seen in the attached print-screen my dll doesn't contain an AxHost that is used to execute the command:IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();Any idea how to solve this?photos attached:http://drop.io/hidden/eopb4tphk8qekl/asset/bm8tZ2V0LW9jeC1qcGc%253Dhttp://drop.io/hidden/eopb4tphk8qekl/asset/Z2V0b2N4LTEtanBn
A: 

Try this (if you haven't already): in Visual Studio, open the form or user control onto which you want to place the RDP control. In the toolbox pane, right-click on a group and select "Choose Items...". When the "Choose Items" window opens, select the "COM Components" tab and find the "Microsoft RDP Client Control (redistributable)" items in the list. (There will be several based on the RDP client version you have installed on your system.) Check the latest version of the control listed and click OK. You'll see an entry in the toolbox for the RDP control; add it to your form. When you do this, the appropriate COM and ActiveX interop assemblies will be automatically generated and placed in your project's output folder, and references to them will be added to your project. See also MSDN.

Dan Ports