加入DHCP [英] Acces to DHCP
问题描述
我正在尝试访问所有的DHCP 接口类型(以太网,wi-fi ......)知道它是否已启用。
I'm trying to have access to DHCP of all interface types (ethernet, wi-fi...) to know if it's enabled or not.
我尝试使用getAdaptersAddresses但它只能工作对于第一个接口。
I tried using getAdaptersAddresses but it only works for the first interface.
我也尝试过使用GetIfTable,我从所有接口获取信息,但找不到任何关于DHCP的信息。
I also tried using GetIfTable, i get informations from all interfaces but can't find anything about DHCP.
你是否知道如何解决这个问题吗?我正在使用C ++,如果它可以提供帮助。
Do you have any idea of how i can solve this ? I'm using C++ if it can help.
谢谢,
推荐答案
你可以使用WMI
Win32_NetworkAdapterConfiguration类及其DHCPEnabled属性看看是否启用了DHCP,如果是,则可以检索返回实例的其他DHCP相关属性。
You can use the WMI Win32_NetworkAdapterConfiguration class and its DHCPEnabled property to see if DHCP is enabled and if it is you can then retrieve otherr DHCP related properties for the returned instance.
这篇关于加入DHCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!