Visual Basic Whitelist Assistance.

A Place For Programmers Of All Levels To Discuss Programming & Web Building.

Moderator: Community Moderator

Post Reply
User avatar
MASTALOL
First Adjutant
First Adjutant
Posts: 302
Joined: 16 Jun 2010, 17:59
Location: SC
Has thanked: 2 times
Been thanked: 1 time
Contact:

Visual Basic Whitelist Assistance.

Post by MASTALOL »

This is a program I am writing for close friends, and I don't want anyone other than my friends to get access to it, I have in the past use a GUID but my old code broke, so I resorted to using IP's.

What I am requesting:
A. Assitance re-creating the GUID or HWID method
OR
B. Assitance making this method work...

Currently it works most of the time, but if you continue to open, close, open, close it somtimes allows you to access the program.


here is the code:

Code: Select all

Dim IPRRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://api.ipify.org/")
        Dim IPRResponse As System.Net.HttpWebResponse = IPRRequest.GetResponse()
        Dim IPRSR As System.IO.StreamReader = New System.IO.StreamReader(IPRResponse.GetResponseStream)
        Dim IPRAdded As String = IPRSR.ReadToEnd
        IP.Text = IPRAdded
        Dim IPRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://CENSORED.com/whitelist.txt")
        Dim IPResponse As System.Net.HttpWebResponse = IPRequest.GetResponse()
        Dim IPSR As System.IO.StreamReader = New System.IO.StreamReader(IPResponse.GetResponseStream)
        Dim IPAdded As String = IPSR.ReadToEnd
        Dim ThisIP As String = IP.Text
        If ThisIP = "Error" Then
            MessageBox.Show("Error Retrieving IP!" & vbNewLine & "Please try again!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
            Exit Sub
        End If
        If IPAdded.Contains(ThisIP) = False Then
            MessageBox.Show("You Are Not Whitelisted!" & vbNewLine & "Please Contact An Admin For Access!" & vbNewLine & "Your IP: " + IP.Text, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
            Exit Sub
        End If
We All Can't Save The World, Someone Needs To Sit On The Curb And Cheer The Hero's On
Image
If you find any links Dead in my posts, Please take a moment to PM me, i will fix them!

Check out My Upload List!

Dropbox - Simplify your life Join Now!
Image
Voted The BEST Cloud Storage!
Post Reply

Return to “Programming/Web Building Chat & Support”