Thank you,Nicholas Paldino.
I have tried your advice and it sucessfully works. Thanks again.
Crespo
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> дÈëÏûÏ¢
news:OufwCbtkGHA.1260@TK2MSFTNGP05.phx.gbl...
Crespo,
I would use the classes in the System.Management namespace to get the
information from the OS itself, not do a lookup.
You can look for instances of the Win32_NetworkAdapterConfiguration for
the network card you want to work with, and then get the IPAddress property
which is an array of the IP addresses that are associated with the network
adapter.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mvp@spam.guard.caspershouse.com
"crespo" <wuhuanfa@21cn.com> wrote in message
news:%23fl6JjqkGHA.4660@TK2MSFTNGP05.phx.gbl...[color=blue]
> hi,Everybody.
> I want to get my computer's local IP address,I search internet for some
> help,but most of them suggests using DNS with
> codes like these:
> IPHostEntry ihe = Dns.GetHostByName(Dns.GetHostName());
> IPAddress myself = ihe.AddressList[0];
>
> But I don't want to use DNS,Could anyone help me? Any suggestions will be
> really appreciated.
>
> Best regards
>
> Crespo
>
> 2006-06-18
>
>
>
>[/color]