Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法使用 C 获取 DNS 服务器 IP 地址。我尝试过使用,但它只能使用和IP_ADAPTER_INFO获取主 WINS 服务器 IP 地址和次要 WINS 服务器 IP 地址。pAdapter->PrimaryWinsServerpAdapter->SecondaryWinsServer
IP_ADAPTER_INFO
pAdapter->PrimaryWinsServer
pAdapter->SecondaryWinsServer
根据我的知识,WINS 服务器和 DNS 服务器是两种不同类型的服务器。
使用GetAdaptersAddresses(), 并查看IP_ADAPTER_ADDRESS结构。
GetAdaptersAddresses()
IP_ADAPTER_ADDRESS