04-06-2010, 01:07 AM
How to make an IP Finder
Open VB
Press File>New Project and press OK.
Now make:
Label1 text: "Website:"
Label2 text: "IP:"
Button text: "Get IP"
Put the first TextBox next to "Website:" and at (Name) put "TextSite"
Put the second TextBox next to "IP:" and at (Name) put "TextIp"
Go to the code and delete everything.
Then copy and paste this code:
Open VB
Press File>New Project and press OK.
Now make:
- 2 Labels
- 2 TextBoxes
- 1 Button
Label1 text: "Website:"
Label2 text: "IP:"
Button text: "Get IP"
Put the first TextBox next to "Website:" and at (Name) put "TextSite"
Put the second TextBox next to "IP:" and at (Name) put "TextIp"
Go to the code and delete everything.
Then copy and paste this code:
Code:
Imports System.Net
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If TextSite.Text.Contains("http://") Then
Dim iphe As IPHostEntry = Dns.GetHostEntry(TextSite.Text.Replace("http://", String.Empty))
TextIp.Text = iphe.AddressList(0).ToString()
Else
Dim iphe As IPHostEntry = Dns.GetHostEntry(TextSite.Text)
TextIp.Text = iphe.AddressList(0).ToString()
End If
Catch ex As Exception
MsgBox(ex)
End Try
End Sub
End Class