here is the code:
'//WAN IP
Dim url As String
Dim myexpression As New Regex("[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}")
Dim MyIPAddress As MatchCollection
url = "http:\\www.whatsmyip.com"
Dim objWebClient As WebClient = New WebClient
Dim objData As Stream = objWebClient.OpenRead(url)
Dim streader As StreamReader = New StreamReader(objData)
Dim HostIP As IPAddress
HostIP = Dns.GetHostEntry(Dns.GetHostName).AddressList.GetValue(0)
MyIPAddress = myexpression.Matches(streader.ReadToEnd())
If MyIPAddress.ToString = "" Then
This used to work in VB.NET 2005, before updating all the service packs.