IP Viewer [Free Project | Tutorial]
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.
This is my tutorial on how to make an application that retrieves your Internal, External and MAC Address.
You will need:
1 Button: Name it 'Get Information'
3 Text box's
3 labels
Place textbox1 at the top of your form and put a label next to it, change the text of the label to 'Internal IP Address'
Place textbox2 under textbox1 and then place a label next to the textbox2 and change the text of the label to 'External IP Address'
Place textbox3 under textbox2 and then place a label next to the textbox3 and change the text of the label to 'MAC Address'
Place the button under all of textbox's and labels, re size, edit, design your form however you would like it. Then add the code and enjoy!
Happy coding!
-Code
You will need:
1 Button: Name it 'Get Information'
3 Text box's
3 labels
Place textbox1 at the top of your form and put a label next to it, change the text of the label to 'Internal IP Address'
Place textbox2 under textbox1 and then place a label next to the textbox2 and change the text of the label to 'External IP Address'
Place textbox3 under textbox2 and then place a label next to the textbox3 and change the text of the label to 'MAC Address'
Place the button under all of textbox's and labels, re size, edit, design your form however you would like it. Then add the code and enjoy!
Code: Select all
Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Net.NetworkInformation.NetworkInterface
Public Class Form1
'Getting the Mac Address
Function getMacAddress()
Dim nics() As NetworkInterface = _
NetworkInterface.GetAllNetworkInterfaces
Return nics(0).GetPhysicalAddress.ToString
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'External IP
Dim webclient As New System.Net.WebClient
Dim ipaddress As String
ipaddress = System.Text.Encoding.ASCII.GetString(( _
webclient.DownloadData("http://automation.whatismyip.com/n09230945.asp")))
TextBox1.Text = ipaddress
'Internal IP
Dim Ip As IPHostEntry = Dns.GetHostEntry(Dns.GetHostName)
For Each internalIP As Net.IPAddress In Ip.AddressList
If internalIP.AddressFamily = Net.Sockets.AddressFamily.InterNetwork Then
TextBox2.Text = internalIP.ToString
End If
Next
'MAC Address
TextBox3.Text = getMacAddress()
End Sub
End Class
Happy coding!
-Code
You do not have the required permissions to view the files attached to this post.
Last edited by Code on Fri Sep 23, 2011 2:03 am, edited 1 time in total.
Good tut, but insted of "http://automation.whatismyip.com/n09230945.asp", you can use "http://whatismyip.org/", since whatismyip.com sometimes changes automation address.
M1z23R wrote:Good tut, but insted of "http://automation.whatismyip.com/n09230945.asp", you can use "http://whatismyip.org/", since whatismyip.com sometimes changes automation address.But you would then have to parse the tag that contains the IP address. The automation page changing is easy handled, go to the automation rules page http://www.whatismyip.com/faq/automation.asp and search for the right HTMLElement and get its value.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

M1z23R wrote:Good tut, but insted of "http://automation.whatismyip.com/n09230945.asp", you can use "http://whatismyip.org/", since whatismyip.com sometimes changes automation address.I had previously looked that information up and that url is for developers, its a perma link

Code wrote:It is not a permanent link, unfortunately :( the link has changed several times, and i needed to change the link in one of my applications because i though it was permanent. :(M1z23R wrote:Good tut, but insted of "http://automation.whatismyip.com/n09230945.asp", you can use "http://whatismyip.org/", since whatismyip.com sometimes changes automation address.I had previously looked that information up and that url is for developers, its a perma linkgoofy;
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

MrAksel wrote::(Code wrote:It is not a permanent link, unfortunately :( the link has changed several times, and i needed to change the link in one of my applications because i though it was permanent. :(M1z23R wrote:Good tut, but insted of "http://automation.whatismyip.com/n09230945.asp", you can use "http://whatismyip.org/", since whatismyip.com sometimes changes automation address.I had previously looked that information up and that url is for developers, its a perma linkgoofy;
No need for tag search 
This works perfectly for me
I don't know if you read it carefully
i said "http://whatismyip.ORG" not "http://whatismyip.COM" 

This works perfectly for me
Code: Select all
Edit: Dim theRequest As WebRequest = WebRequest.Create("http://whatismyip.org")
Dim theResponse As WebResponse = CType(theRequest.GetResponse, HttpWebResponse)
Dim theReader As New StreamReader(theResponse.GetResponseStream())
TextBox1.Text = theReader.ReadToEnd()
theReader.Close()
I don't know if you read it carefully


M1z23R wrote: I don't know if you read it carefullyOhh :P my mistakei said "http://whatismyip.ORG" not "http://whatismyip.COM"

LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Copyright Information
Copyright © Codenstuff.com 2020 - 2023