Just Pm me the project, Ill fix it
heres some code for a project
the only thing is that, if i had xx.xxx.xxx.xxx in textbox1.text and 89.565.676.676 it would not detect: " If Label2.Tex*****ntains(xx.xxx.xxx.xxx)Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Label2.Tex*****ntains(TextBox1.Text) Then Label4.Visible = True Label4.Text = "You Are Banned!" Else Label4.Visible = True Label4.Text = "Not Banned. :/" End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label2.Text = ShowIp() Dim Read As New System.IO.StreamReader(Application.StartupPath & "Adress.txt") TextBox1.Text = "89.565.676.676" & Environment.NewLine & Read.ReadToEnd Read.Close() End Sub
Just Pm me the project, Ill fix it
@help
Your right, however he would still have to paste the code to fix the error as is (or more of it) And either Myself, Yourself, Lolland, or Bombsaway would have resolved the issue anyway by discovering the problem and posting the solution, I was just trying to make my life easier and not have to create the controls
@explain more,
That's why I suggested the PM, the error could be derived from another part in the code, the snippet won't help, because to the best of my knowledge, there "is nothing wrong"
He is using my "real" Ip tutorial to create a IPaddress block for his software
Why does everyone make things complicated , when it could be achieved so easilyCode:If Label2.Tex*****ntains(TextBox1.Text) Then Label4.Visible = True Label4.Text = "You Are Banned!" Else Label4.Visible = True Label4.Text = "Not Banned. :/" End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label2.Text = ShowIp() Dim Read As New System.IO.StreamReader(Application.StartupPath & "Adress.txt") TextBox1.Text = "89.565.676.676" & Environment.NewLine & Read.ReadToEnd Read.Close()
I created the module, use it
Code:Form Load If ShowIp() = "45.286.279.68" Then MsgBox("Your banned") Else MsgBox("Welcome") End If
Code:or use texbox1.text = showip()You get the idea, If your already using my module, then may as well take advantage if it's simplicityCode:If textbox1.text = "62.98.132.453" then Yada yada yada end if
Now you can get more advanced and create a database and have the database on a server and have use it to ban in real time
Last edited by NextGen1; 01-25-2010 at 08:44 AM.
You will have to check the application users IP
Last edited by NextGen1; 01-25-2010 at 09:58 AM.
Yeah, it would make life easier,
Edit: One sec, I see whats wrong, It's loading but not "nextline" (vbCRLF)
let me see...
I'm replacing your textbox with a List view control, this should work ;p
Here you go
Add a listview instead of textbox and replace your code with the one above.Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Label2.Tex*****ntains(ListView1.Text) Then Label4.Visible = True Label4.Text = "You Are Banned!" Else Label4.Visible = True Label4.Text = "Not Banned. :/" End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label2.Text = ShowIp() Dim str As String = "" Dim ary() As String str = My.Computer.FileSystem.ReadAllText(Application.StartupPath & "Adress.txt") ary = Split(str, vbNewLine) Dim x As Integer For x = 0 To UBound(ary) If ary(x) <> "" Then ListView1.Items.Add(ary(x)) End If Next End Sub End Class
It should now download a list and check it against the file.
(works for me)
Last edited by NextGen1; 01-25-2010 at 09:57 AM.
mnpeepno2 (01-25-2010)
As always not a problem