SOL1102
SOL1102

Reputation: 512

VB.NET Get Website IP Address Using HTTPWebRequest?

Is it possible to obtain the website's IP address that you are connecting to on a HTTPWebRequest session?

I'm looking to do this for an authentication check in a licensing class to prevent people from chainging their hosts.etc file and sending false replies to crack my software.

Upvotes: 1

Views: 2177

Answers (2)

SOL1102
SOL1102

Reputation: 512

Above thread was correct, code used below:

For Each IP In Dns.GetHostEntry("website.com").AddressList
            If IP.ToString() <> "websiteip" Then
                MessageBox.Show("Not connecting to correct IP address")
                Exit Sub
            End If
        Next

Upvotes: 0

Truezplaya
Truezplaya

Reputation: 1313

When retrieving URL via HttpWebRequest, can I see the IP address of the destination server?

Check out the thread about this might help you

Cheers

Truez

Upvotes: 1

Related Questions