|
-
Apr 1st, 2005, 04:31 PM
#1
Thread Starter
Frenzied Member
Get IP address
Hi
How can I retrieve my IP address from a C# Windows App??
-
Apr 1st, 2005, 04:45 PM
#2
Member
Re: Get IP address
This should help you out.
-
Apr 1st, 2005, 04:47 PM
#3
Thread Starter
Frenzied Member
Re: Get IP address
I already looked at that But its console, and I can't figure out how to convert the IP thing at the bottom to a windows app....
-
Apr 1st, 2005, 05:06 PM
#4
Member
Re: Get IP address
Hmmm I guess I don't understand this should give you your IP address:
VB Code:
private void Form1_Load(object sender, System.EventArgs e)
{
String strHostName = "";
IPHostEntry ipEntry = Dns.GetHostByName (strHostName);
IPAddress [] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
strHostName += addr[i].ToString();
}
textBox1.Text = "Your IP is: " + strHostName;
}
Or am I way off on what you wan't here? lol
-
Apr 1st, 2005, 05:37 PM
#5
Thread Starter
Frenzied Member
Re: Get IP address
Exactly what I needed thx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|