• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1150
  • Last Modified:

Get IPv4 from ipconfig from a C# console program

Hi all,

How can I get the IPv4 that shows up when you run ipconfig into a c# console app?
0
ehensens
Asked:
ehensens
1 Solution
 
jjardineCommented:
Try this:

System.net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList[0].ToString();
0
 
ehensensAuthor Commented:
Thanks a bunch.
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now