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

2006-03-26 Thread Colin JN Breame
On Friday 24 March 2006 21:13, Adam Tauno Williams wrote: Can't this information be acquired just by reading some file in /proc? I had a quick look but I couldn't see anything and I'm not sure where you would find out. Maybe this is something missing from the /proc filesystem - maybe it's

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

2006-03-24 Thread Colin JN Breame
You can get the address using the SIOCGIFADDR ioctl. You'd probably have to do this in C. Your best bet might be to parse the output from ifconfig. -- Colin On Thursday 23 March 2006 17:06, Stephan Eberle wrote: Hi El, That's a good start. Do you know of any possibility to point out the

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

2006-03-24 Thread Adam Tauno Williams
On Fri, 2006-03-24 at 12:08 +, Colin JN Breame wrote: You can get the address using the SIOCGIFADDR ioctl. You'd probably have to do this in C. Your best bet might be to parse the output from ifconfig. Can't this information be acquired just by reading some file in /proc? signature.asc

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

2006-03-23 Thread Stephan Eberle
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@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list

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

2006-03-23 Thread Elliott Draper
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

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

2006-03-23 Thread Stephan Eberle
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; ),

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

2006-03-23 Thread Jonel Rienton
One ugly hack is to use Process.Start, use ifconfig as the process; On 3/23/06, Elliott Draper [EMAIL PROTECTED] wrote: Hmm, I can't think of an easy way to retrieve that information from within the .Net/Mono class library, anyone else have any ideas or come across this before? Cheers, -=