我正在尝试通过调用 API 或使用 WMI 来检测计算机是否连接到域。
我目前正在阅读环境。变量 USERDOMAIN 来检查我是否连接到域,但这只适用于我知道的域。 有没有更好的方法来查看我是否连接到 LAN/域?
代码在 C 中,适用于 windows XP 或 7。
谢谢。
最佳答案
尝试 NetGetJoinInformation .它可以给你四个结果。
NetSetupUnknownStatus The status is unknown. NetSetupUnjoined The computer is not joined. NetSetupWorkgroupName The computer is joined to a workgroup. NetSetupDomainName The computer is joined to a domain.
关于c - 检测到域的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3303171/