Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get computer name and IP address of local computer

Tags:

c#

How can I get the computer name and IP address of my PC programmatically? For example, I want to display that information in a text box.

like image 636
Holyoxx Avatar asked Jan 24 '11 05:01

Holyoxx


People also ask

How do I find my LAN computer name?

win+r then type cmd and then press enter . This should display a table of names. The name associated with the type "Unique" is the name of the computer. The name associated with the type "Group" should be the workgroup the computer is joined on.

Can you identify a computer by IP address?

There is no method of associating an exact physical geographical address or the computer associated with an IP address available to an end-user. If you need to report abuse by a person behind an IP address, contact local authorities or the ISP who's in control of that IP address.


1 Answers

Have a look at this: link

and this: link

textBox1.Text = "Computer Name: " + Environment.MachineName

textBox2.Text = "IP Add: " + Dns.GetHostAddresses(Environment.MachineName)[0].ToString();
like image 57
Rye Avatar answered Nov 10 '22 02:11

Rye