gpt4 book ai didi

c - 检测到域的连接

转载 作者:太空宇宙 更新时间:2023-11-04 04:08:06 24 4
gpt4 key购买 nike

我正在尝试通过调用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com