Solved

Get IPv4 from ipconfig from a C# console program

Posted on 2009-04-08
2
1,025 Views
Last Modified: 2012-05-06
Hi all,

How can I get the IPv4 that shows up when you run ipconfig into a c# console app?
0
Comment
Question by:ehensens
2 Comments
 
LVL 14

Accepted Solution

by:
jjardine earned 300 total points
ID: 24100567
Try this:

System.net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList[0].ToString();
0
 

Author Closing Comment

by:ehensens
ID: 31568182
Thanks a bunch.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question