Click here to Skip to main content
15,886,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
How can i create a remote desktop connection app that connects through the internet. I can make a connection between computers that are on the same network using Microsoft terminal service client control but i can't seem to connect to a computer that's not on the same network. I'm using vb.net but should you have some code in C# it doesn't matter i will convert it.
The below code works fine only if the computers are on the same network.

VB
If rdp.Connected.ToString() = "0" Then

Try

    rdp.Server = "test-PC"
    rdp.UserName = "test"
Dim secured As IMsTscNonScriptable = DirectCast(rdp.GetOcx(), IMsTscNonScriptable)
    secured.ClearTextPassword = "test"

    rdp.Connect()

 Catch ex As Exception

 MessageBox.Show(ex.Message, Me.Name, MessageBoxButtons.OK, MessageBoxIcon.Error)

 End Try

 End If



Your response will be highly appreciated.
Posted

This requires a little knowledge about network systems...

There are private IP's and public IP's, and if you have a home network, your computers that are internal probably all have private IP's (that is, 192.168.xxx.xxx or something similar). Most ISP's only give one public IP and the router (cable modem, DSL modem, etc) usually consumes it. Some routers can be configured to pass public IP data directly to a configured private IP address in the network, or you can set up NAT (Network Address Translation) or port forwarding to route specific ports to specific computers. You will also need to configure the firewall on the computer to accept this traffic.

Public IP's issued by ISP's change randomly, sometimes you can have them for days, weeks, or months or they can last a few hours. You can use a service like DynDNS to have an address for your computer like myhomepc.dyndns.org or something similar, check out the services they offer or search on Google for Dynamic DNS Service.

The name that you are using in your code is a NETBIOS name which happens to be the same as your computer name since Windows associates the two automatically. That name is not publicly available outside your private network. The only way to make something visible outside the network like that is to expose your computer to the internet and use DynDNS or purchase a static IP from your ISP and use a normal DNS service to register a domain name and point it to that static IP.
 
Share this answer
 
Comments
yogeshbhave@rediffmail.com 29-Dec-14 2:05am    
How Teamviewer / Amee Admin work without satic IP ?
and allow user to share desktop
check this solution

remote desktop connection[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900