IP Banner

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
13 posts Page 1 of 2
Contributors
User avatar
thcodepro
Just Registered
Just Registered
Posts: 7
Joined: Tue Jun 28, 2011 4:15 pm

IP Banner
thcodepro
Add 1 Textbox

textbox visible = false


Code:
Code: Select all
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Hide()
        Try
            Dim web As New System.Net.WebClient
            Dim miip As String
            miip = System.Text.Encoding.ASCII.GetString(( _
            web.DownloadData("http://automation.whatismyip.com/n09230945.asp")))
            TextBox1.Text = miip
        Catch ex As Exception
            MsgBox("Error", MsgBoxStyle.Critical, "Error")
            End
        End Try

        'banned list start here------------------------------------------------------------------
        If TextBox1.Text = "IP here" Then
            MsgBox("Your ip address is banned!", MsgBoxStyle.Critical, "Banned")
            End
        ElseIf TextBox1.Text = "IP here" Then
            MsgBox("Your ip address is banned!", MsgBoxStyle.Critical, "Banned")
            End
        ElseIf TextBox1.Text = "IP here" Then
            MsgBox("Your ip address is banned!", MsgBoxStyle.Critical, "Banned")
            End
        ElseIf TextBox1.Text = "IP here" Then
            MsgBox("Your ip address is banned!", MsgBoxStyle.Critical, "Banned")
            End
        ElseIf TextBox1.Text = "IP here" Then
            MsgBox("Your ip address is banned!", MsgBoxStyle.Critical, "Banned")
            End
        Else
            MsgBox("Your IP address is not banned!", MsgBoxStyle.Information, "Not Banned")
        End If
        'banned list stop here------------------------------------------------------------------
    End Sub
End Class

Remove this text in the code: IP here

and enter the IP address to be banned
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: IP Banner
M1z23R
What should we use this for :/ ?
User avatar
thcodepro
Just Registered
Just Registered
Posts: 7
Joined: Tue Jun 28, 2011 4:15 pm

Re: IP Banner
thcodepro
For example: in a chat program for spammers, etc.
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: IP Banner
M1z23R
Yes, but this is how to check your own IP.
User avatar
thcodepro
Just Registered
Just Registered
Posts: 7
Joined: Tue Jun 28, 2011 4:15 pm

Re: IP Banner
thcodepro
No! you must put this into a program so if you want to exclude anyone so enter the ip address them so when they start the program Will it check the ip address!
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: IP Banner
M1z23R
This can be done in client app :D my bad
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: IP Banner
mandai
You would have more control if the banned IPs could be updated.
User avatar
thcodepro
Just Registered
Just Registered
Posts: 7
Joined: Tue Jun 28, 2011 4:15 pm

Re: IP Banner
thcodepro
I use the update ...

I have used the IP banner on a chat program to think it works fine.
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

Re: IP Banner
pip
Nice i like this it works for me in my apps
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
tsuyoka
Member
Member
Posts: 40
Joined: Sat May 22, 2010 6:56 pm

Re: IP Banner
tsuyoka
It would be better is you used an array sorta like :
Code: Select all
Dim IP as String
Dim IPs() as String

For Each IP in IPs
     If IP = Textbox1.Text Then
          MsgBox("You are Banned!")
     End If
Next
Then you could just add the ip to the array and you wont run out of if statments. Its still a good code so great work clapper;
13 posts Page 1 of 2
Return to “Tutorials”