.net 3.5: (ip2hostname) 查找某个IP是否被域中的另一台计算机使用

发布于 2024-09-08 00:14:07 字数 335 浏览 5 评论 0原文

我正在一个域下工作,我正在制作一个应用程序,将 ip 从 1 更改为 253,直到找到一个可用的、无冲突的 ip(它从域获取 ping 响应,每次更改 ip 时都会尝试 ping 它),这部分有效。问题是,我不希望程序覆盖其他被简单关闭的计算机使用的 IP 地址,这就是为什么它在之前的过程中没有与它们发生冲突。

所以我的问题基本上是,

我如何查明我刚刚更改的 IP 是否被我域中的另一台计算机使用? (计算机可能已关闭,否则会发生冲突)

奇怪的问题&任务,我知道。

我不介意使用外部 cmd 工具,将输出流式传输到我的代码,只要它是内置窗口即可。

I'm working under a domain, and im making an app that changes ip from 1 to 253 until it finds an available, unconfliced ip (where it get's ping response from the domain, it tries to ping it each time it changes ip), this part works. the problem is, that i dont want the program to override an ip address that is used by other computers that are simply shut down, and thats why it didnt conflict them in the previous process.

so my question basicly is,

how do i find out if the ip i just changed to is used by another computer in my domain? (computer is probably shutdown or else it would be confliced)

weird question & task, i know.

I don't mind using an external cmd tool, streaming the output to my code, as long as it's built-in windows.

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

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

发布评论

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

评论(1

乞讨 2024-09-15 00:14:07

如果您的计算机通过 DHCP 获取 IP,您可以检查 DHCP 租约。
否则,也许您可​​以从 Active Directory 获取一些信息,但我不确定它是否将 IP 存储在计算机帐户中。

If your computers get their ips by DHCP, you could check the DHCP leases.
Otherwise maybe you can get some information from the Active Directory, but I'm not sure it stores the IP within the computer account.

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