Get Wan IP Code doesn't work HELP

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 65
Reputation: SolTec is an unknown quantity at this point 
Solved Threads: 4
SolTec SolTec is offline Offline
Junior Poster in Training

Get Wan IP Code doesn't work HELP

 
0
  #1
Mar 29th, 2008
here is the code:

  1. '//WAN IP
  2. Dim url As String
  3. 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}")
  4. Dim MyIPAddress As MatchCollection
  5. url = "http:\\www.whatsmyip.com"
  6. Dim objWebClient As WebClient = New WebClient
  7. Dim objData As Stream = objWebClient.OpenRead(url)
  8. Dim streader As StreamReader = New StreamReader(objData)
  9. Dim HostIP As IPAddress
  10. HostIP = Dns.GetHostEntry(Dns.GetHostName).AddressList.GetValue(0)
  11. MyIPAddress = myexpression.Matches(streader.ReadToEnd())
  12. If MyIPAddress.ToString = "" Then

This used to work in VB.NET 2005, before updating all the service packs.
The journey of a thousand miles, begins with the first step!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC