SolTec 0 Junior Poster in Training

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.