how can I know that the option of "Obtain DNS server address automatically" in Internet Protocol(TCP\IP) property have be set or checked by coding ?

> > how can I know that the option of "Obtain DNS server address
> > automatically" in Internet Protocol(TCP\IP) property have be set or
> > checked by coding ? I need to judge it and change "Obtain DNS server
> > address
> > automatically" to "Use the following DNS server addresses";
> > Are there any api or other methods to get it?




AliR (VC++ MVP) wrote:
> You can call GetAdaptersInfo(...).  The DhcpEnabled member of
> IP_ADAPTER_INFO tells you if DHCP is enabled or not.

> AliR.




AliR
Thank your reply.but if DHCP is enabled or not  is not what I want to
care.
If DHCP is enabled or not  only can tell that "Obtain an IP address
 automatically"  has been checked. It have been known by me.
I only want to know whether the option of "Obtain DNS server address
automatically" have been set or not?How to know it.

0
10/25/2006 1:56:17 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
741 Views

Similar Articles

[PageSpeed] 27

You are right my ealier suggestion wasn't very helpful.

I went digging around in the registry. I traced the changes to the network
settings to this key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interf
aces

Under this key are a bunch of adapter ids.  Under each adapter id are the
settings.  If the value of NameServer is blank then it mean that Find DNS
server automatically is set, if it has a value then its not set and the
address(s) are there.

Doing a search on the key got this site
http://support.microsoft.com/kb/314053

AliR.

"flyingco" <zhouyou3000@gmail.com> wrote in message
news:1161741376.932773.52100@i42g2000cwa.googlegroups.com...
> > > how can I know that the option of "Obtain DNS server address
> > > automatically" in Internet Protocol(TCP\IP) property have be set or
> > > checked by coding ? I need to judge it and change "Obtain DNS server
> > > address
> > > automatically" to "Use the following DNS server addresses";
> > > Are there any api or other methods to get it?
>
>
>
>
> AliR (VC++ MVP) wrote:
> > You can call GetAdaptersInfo(...).  The DhcpEnabled member of
> > IP_ADAPTER_INFO tells you if DHCP is enabled or not.
>
> > AliR.
>
>
>
>
> AliR
> Thank your reply.but if DHCP is enabled or not  is not what I want to
> care.
> If DHCP is enabled or not  only can tell that "Obtain an IP address
>  automatically"  has been checked. It have been known by me.
> I only want to know whether the option of "Obtain DNS server address
> automatically" have been set or not?How to know it.
>


0
AliR3470 (3236)
10/25/2006 6:32:30 PM
AliR (VC++ MVP) wrote:
> You are right my ealier suggestion wasn't very helpful.
>
> I went digging around in the registry. I traced the changes to the network
> settings to this key
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interf
> aces
>
> Under this key are a bunch of adapter ids.  Under each adapter id are the
> settings.  If the value of NameServer is blank then it mean that Find DNS
> server automatically is set, if it has a value then its not set and the
> address(s) are there.
>
> Doing a search on the key got this site
> http://support.microsoft.com/kb/314053
>
> AliR.
>
> "flyingco" <zhouyou3000@gmail.com> wrote in message
> news:1161741376.932773.52100@i42g2000cwa.googlegroups.com...
> > > > how can I know that the option of "Obtain DNS server address
> > > > automatically" in Internet Protocol(TCP\IP) property have be set or
> > > > checked by coding ? I need to judge it and change "Obtain DNS server
> > > > address
> > > > automatically" to "Use the following DNS server addresses";
> > > > Are there any api or other methods to get it?
> >
> >
> >
> >
> > AliR (VC++ MVP) wrote:
> > > You can call GetAdaptersInfo(...).  The DhcpEnabled member of
> > > IP_ADAPTER_INFO tells you if DHCP is enabled or not.
> >
> > > AliR.
> >
> >
> >
> >
> > AliR
> > Thank your reply.but if DHCP is enabled or not  is not what I want to
> > care.
> > If DHCP is enabled or not  only can tell that "Obtain an IP address
> >  automatically"  has been checked. It have been known by me.
> > I only want to know whether the option of "Obtain DNS server address
> > automatically" have been set or not?How to know it.
> >
AliR
Thank you very much! I have done it like you ever,but don't find the
exact evidence to get it.
but you have finished it very good .

0
10/26/2006 2:02:50 AM
Reply:

Similar Artilces:

how can I know that the option of "Obtain DNS server address automatically" have be set or checked by coding?
how can I know that the option of "Obtain DNS server address automatically" in Internet Protocol(TCP\IP) property have be set or checked by coding ? I need to judge it and change "Obtain DNS server address automatically" to "Use the following DNS server addresses"; Are there any api or other methods to get it? You can call GetAdaptersInfo(...). The DhcpEnabled member of IP_ADAPTER_INFO tells you if DHCP is enabled or not. AliR. "flyingco" <zhouyou3000@gmail.com> wrote in message news:1161669642.332731.240670@h48g2000cwc.googlegroups.com... >...

how can I know that the option of "Obtain DNS server address automatically" in Internet Protocol(TCP\IP) property have be set or checked by coding ?
> > how can I know that the option of "Obtain DNS server address > > automatically" in Internet Protocol(TCP\IP) property have be set or > > checked by coding ? I need to judge it and change "Obtain DNS server > > address > > automatically" to "Use the following DNS server addresses"; > > Are there any api or other methods to get it? AliR (VC++ MVP) wrote: > You can call GetAdaptersInfo(...). The DhcpEnabled member of > IP_ADAPTER_INFO tells you if DHCP is enabled or not. > AliR. AliR Thank your reply.but if D...