[Mono-list] How to determine local IP address with mono on linux?

Stephan Eberle hawke at deltacity.org
Thu Mar 23 12:06:48 EST 2006


Hi El,

That's a good start. Do you know of any possibility to point out the device 
(eth0, eth1, wlan0, ...) behind each address?

Thank's,
Stevie

On Thursday 23 March 2006 18:03, Elliott Draper wrote:
> Hi there,
>
> Add a reference to System.Net to the top of your code file ("using
> System.Net; "), and then try this:
>
> foreach(IPAddress address in
> Dns.GetHostByName(Environment.MachineName).AddressList) {
> Console.WriteLine(address.ToString());
> }
>
> That simply prints out each IP address for your local machine to the
> console, however you can do whatever you need to do within that
> enumeration.
>
> Hope that helps,
> -= El =-
>
> On Thu, 23 Mar 2006 17:48:34 +0100, Stephan Eberle <hawke at deltacity.org> 
wrote:
> > Hi!
> >
> > How can I enumerate my machines IP addresses with mono on a linux box?
> >
> > Any info desperately needed! :)
> >
> > Thank's in advance,
> > Stevie
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list


More information about the Mono-list mailing list