监控领域中连接状态 [英] Monitoring Domain Connectivity Status
问题描述
有没有什么办法来监视域的可用性,当服务器在运行时是未知的? NetworkChange.NetworkAvailabilityChanged
,不跨框架版本/操作系统提供一致的结果。
Is there any way to monitor the availability of a domain, when the server is unknown at runtime? NetworkChange.NetworkAvailabilityChanged
, does not provide consistent results across framework versions/operating systems.
我用移动设备上的域名,这将要持续减肥和重新获取域连接处理;我需要检测code,当这一切发生。
I'm dealing with mobile units on a domain, that are going to consistently lose and re-acquire domain connectivity; and I need to detect in code, when this happens.
我尝试过谷歌,必应和MSDN并拿出什么。
I've tried Google, Bing, and MSDN and come up with nothing.
推荐答案
尝试使用P / Invoke的 NetWkstaUserGetInfo
Try using p/Invoke NetWkstaUserGetInfo
System.Environment.UserDomainName 从获取数据环境变量中。
System.Environment.UserDomainName gets data from environment variable.
这篇关于监控领域中连接状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!