![]() |
![]() OCAU News - Wiki - QuickLinks - Pix - Sponsors |
|
|||||||
| Notices |
|
Sign up for a free OCAU account and this ad will go away! Search our forums with Google: |
![]() |
|
|
Thread Tools |
|
|
#16 | |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
Quote:
Like Pablo suggested we do lablel them, but over time they can come off, some of the older ones don't have them, and the users have been trained over time to quote the IP address. If I asked them for a computer name they would be confused. Then they'd have to try to find it. If I can say, "Click the icon that looks like a house ( If I use a house icon ((Ip ADDRESS get it?))for example) then it would be easier. Plus for remote people (with tablets) they can't see the labels because they are behind the covers.. I guessed there would probably be nicer already exisiting programs, but yeah I was just more keen to try to build one to help learn it. Last edited by andyroo54; 9th July 2012 at 12:17 PM. |
|
|
|
|
| Join OCAU to remove this ad! |
|
|
#17 |
|
Member
Join Date: May 2009
Location: chermside.bris.qld.au:80
Posts: 2,601
|
Code:
Dim strHostName As String strHostName = System.Net.Dns.GetHostName() EDIT: Whoops I should probably learn to read haha, carry on. Last edited by zach; 9th July 2012 at 12:27 PM. |
|
|
|
|
|
#18 | |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
Quote:
Edit I've added this to show machine name: Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox2.Text = (Environment.MachineName)
End Sub
Last edited by andyroo54; 9th July 2012 at 12:56 PM. |
|
|
|
|
|
|
#19 | |
|
Member
Join Date: Apr 2007
Location: Adelaide
Posts: 3,491
|
Quote:
__________________
|
|
|
|
|
|
|
#20 | |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
Quote:
But 99% of our users don't have virtuals, and if they do, they can click show PC name.. This is awesome thanks everyone for their help. I will credit you in the code! I'm going to make an installer and I'll upload it when it's done. Thanks, |
|
|
|
|
|
|
#21 | |
|
Member
Join Date: Apr 2007
Location: Adelaide
Posts: 3,491
|
Quote:
Click to view full size! If you can't find the properties window click on the textbox in the designer and press F4.
__________________
|
|
|
|
|
|
|
#22 | |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
Quote:
If you want to you can download it here: http://sourceforge.net/projects/whatisyourip/ |
|
|
|
|
|
|
#23 |
|
Member
Join Date: Apr 2007
Location: Adelaide
Posts: 3,491
|
haha! ASCII dinosaur! Nice touch.
__________________
|
|
|
|
|
|
#24 |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
|
|
|
|
|
|
#25 |
|
Member
Join Date: Jun 2012
Posts: 592
|
Where's the git repository
![]() Edit: Actually, it would be nice not to have to install to look at the source code... |
|
|
|
|
|
#26 | |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
Quote:
But here is the form code: Code:
Public Class Form1
Public Function GetLocalIP() As String
Dim _IP As String = Nothing
' Resolves a host name or IP address to an IPHostEntry instance.
' IPHostEntry - Provides a container class for Internet host address information.
Dim _IPHostEntry As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName())
' IPAddress class contains the address of a computer on an IP network.
For Each _IPAddress As System.Net.IPAddress In _IPHostEntry.AddressList
' InterNetwork indicates that an IP version 4 address is expected
' when a Socket connects to an endpoint
If _IPAddress.AddressFamily.ToString() = "InterNetwork" Then
_IP = _IPAddress.ToString()
End If
Next _IPAddress
Return _IP
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = GetLocalIP()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox2.Text = (Environment.MachineName)
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub Label3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
'Compiled by andyroo54, with great input from OCAU members: Kreegor andPabloEscobar.
|
|
|
|
|
|
|
#27 |
|
Member
Join Date: Feb 2010
Location: Xanthia
Posts: 2,641
|
Holy crap this things been downloaded a lot?
http://sourceforge.net/projects/what...stats/timeline 46 times with Bangladesh being the top location? Maybe they think it's some kind of hacking tool? Like to find out people's IP addresses? Well technically that's what it's for but you know what I mean. |
|
|
|
|
|
#28 | |
|
Member
Join Date: Jun 2012
Posts: 592
|
Quote:
|
|
|
|
|
|
|
#29 |
|
Member
Join Date: Jan 2002
Location: Sleepwithyourdadelaide
Posts: 23,932
|
I wrote this in 5 minutes for luls
The exe https://dl.dropbox.com/u/1428435/Wha...IpCompiled.zip The .net C# source code and project https://dl.dropbox.com/u/1428435/Wha...alIpSource.zip Code:
private void button1_Click(object sender, EventArgs e)
{
try
{
output.Text = "";
IPHostEntry host;
string localIP = "?";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
output.Text += ip.ToString() + "\n";
}
}
catch (Exception ex)
{
output.Text = "Shit guys, something went wrong!" + ex.Message;
}
}
![]() to convert between C# and VB.net code use this website http://www.developerfusion.com/tools.../csharp-to-vb/
__________________
You know, if you watch Titanic backwards, it's actually a heart warming tale of a ship that jumps out of the water and saves lots of drowning people. Last edited by Foliage; 24th July 2012 at 5:46 PM. |
|
|
|
|
|
#30 |
|
Member
Join Date: Jan 2002
Location: Sleepwithyourdadelaide
Posts: 23,932
|
sure am glad I bothered helping
__________________
You know, if you watch Titanic backwards, it's actually a heart warming tale of a ship that jumps out of the water and saves lots of drowning people. |
|
|
|
![]() |
| Bookmarks |
|
Sign up for a free OCAU account and this ad will go away! |
| Thread Tools | |
|
|