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.
Add 1 Textbox
textbox visible = false
Code:
Remove this text in the code: IP here
and enter the IP address to be banned
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
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!
I use the update ...
I have used the IP banner on a chat program to think it works fine.
I have used the IP banner on a chat program to think it works fine.
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>
It would be better is you used an array sorta like :
Code: Select all
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;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
Copyright Information
Copyright © Codenstuff.com 2020 - 2023