[Mono-dev] gettting ip address
Petit Eric
surfzoid at gmail.com
Thu Dec 18 04:29:26 EST 2008
2008/12/18 sojan <sojankallara at yahoo.com>:
>
> hi i tried to get the ip address of the local machine. The sample code i got
> from the mono is returning only the localhost 127.0.0.1
>
> Do i need to configure anything else to get the local ip address
>
>
> i am using the latest fedora10 OS
>
> please help
IPAddress localAddr = null;
try
{
localAddr =
Dns.GetHostEntry(Varglobal.ServerAdress).AddressList[0];
}
catch (Exception Ex)
{
Console.WriteLine(Ex.Message);
}
if (localAddr == null)
try
{
localAddr = IPAddress.Parse(Varglobal.ServerAdress);
}
catch (Exception Ex)
{
Varglobal.ResEvent.DoSomething(Ex.Message +
Environment.NewLine);
}
> --
> View this message in context: http://www.nabble.com/gettting-ip-address-tp21068672p21068672.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
--
Cordially.
Small Eric Quotations of the days:
---------------------------------------------------------------------------
If one day one reproaches you that your work is not a work of
professional, say you that:
Amateurs built the arch of Noah, and professionals the Titanic.
---------------------------------------------------------------------------
Few people are done for independence, it is the privilege of the powerful ones.
---------------------------------------------------------------------------
No key was wounded during the drafting of this message.
More information about the Mono-devel-list
mailing list