Solved

Get IPv4 from ipconfig from a C# console program

Posted on 2009-04-08
2
985 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
Comment Utility
Try this:

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

Author Closing Comment

by:ehensens
Comment Utility
Thanks a bunch.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now