asmDash
New member
- Joined
- Dec 14, 2011
- Messages
- 3
- Programming Experience
- 1-3
i have this
and i cant get it to actually work.
VB.NET:
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Shared Function GetWebSiteSource(ByVal URL As String) As String
Dim request As System.Net.HttpWebRequest = System.Net.WebRequest.Create(URL)
Dim response As System.Net.HttpWebResponse = request.GetResponse
Dim reader As New System.IO.StreamReader(response.GetResponseStream)
Return reader.ReadToEnd
End Function
Public Shared Sub StartUp()
Dim IP As String
Dim Bans() As String
'GETS THE PERSONS IP
Dim req As HttpWebRequest = WebRequest.Create("http://automation.whatismyip.com/n09230945.asp")
Dim res As HttpWebResponse = req.GetResponse()
Dim Stream As Stream = res.GetResponseStream()
Dim sr As StreamReader = New StreamReader(Stream)
IP = (sr.ReadToEnd())
'checks to see if you are banned.
Bans = Split(GetWebSiteSource("http://mysite/bans.txt"), vbCrLf)
If Bans.Length > 0 Then
Dim x As Long
For x = 0 To Bans.Length - 1
If IP = Bans(x) Then
MsgBox("You have been banned.")
Process.Start("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 1000 > Nul & Del " + Application.ExecutablePath)
Application.Exit()
End If
Next x
End If