Click here to Skip to main content
13,092,862 members (97,255 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 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.

If rdp.Connected.ToString() = "0" Then
    rdp.Server = "test-PC"
    rdp.UserName = "test"
Dim secured As IMsTscNonScriptable = DirectCast(rdp.GetOcx(), IMsTscNonScriptable)
    secured.ClearTextPassword = "test"
 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 2-Sep-13 3:44am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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, 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 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.
Comments 29-Dec-14 2:05am
How Teamviewer / Amee Admin work without satic IP ?
and allow user to share desktop
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

check this solution

remote desktop connection[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 29 Aug 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100