Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB.NET
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.
 
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 2-Sep-13 4:44am
Rate this: bad
good
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, 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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

check this solution
 
remote desktop connection[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 341
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 220
3 Praneet Nadkar 197
4 Shweta N Mishra 161
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 29 Aug 2014
Copyright © CodeProject, 1999-2014
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