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.
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.
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.
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With