Monitoring Domain Connectivity Status

2019-08-13 14:31发布

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.

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.

I've tried Google, Bing, and MSDN and come up with nothing.

2条回答
三岁会撩人
2楼-- · 2019-08-13 14:56

Try using p/Invoke NetWkstaUserGetInfo

System.Environment.UserDomainName gets data from environment variable.

查看更多
霸刀☆藐视天下
3楼-- · 2019-08-13 14:56

You mean like the System.Environment.UserDomainName property?

查看更多
登录 后发表回答