Imports System.Net Imports System.IO Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Internal Try Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName) Dim strLocalIp As String = h.AddressList.GetValue(0).ToString TextBox1.Text = strLocalIp Catch EX As Exception End Try 'External Dim web As New System.Net.WebClient Dim myIP As String myIP = System.Text.Encoding.ASCII.GetString(( _ web.DownloadData("http://whatismyip.com/automation/faq/n09230945.asp"))) TextBox2.Text = myIP End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)