获取工作站或服务器上的域名

发布于 2024-08-08 07:18:34 字数 177 浏览 2 评论 0原文

有些系统没有配置域名,或者可能有domain.local 形式的域名;但它们位于一个域内。

有没有办法获取这些系统所属的域?

我已经尝试使用经典 API:

NetWkstaGetInfo() DnsQueryConfig()

和许多其他...

代码值得赞赏。

Some systems don't have a domain name configured or they might have something in the form of domain.local; yet they are located within a domain.

Is there a way to get the domain these system belong to?

I already tried using the classic APIs:

NetWkstaGetInfo()
DnsQueryConfig()

and many others...

Code is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ペ泪落弦音 2024-08-15 07:18:34

尝试 GetComputerNameEx()

GetComputerNameEx(ComputerNameDnsDomain, pszBuffer, &dwLength)

Try GetComputerNameEx()

GetComputerNameEx(ComputerNameDnsDomain, pszBuffer, &dwLength)
2024-08-15 07:18:34

getdomainname()

抱歉,刚刚注意到windows 标签,请参阅网络功能列表

getdomainname()

Sorry just noticed the windows tag, see list of network functions

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文