How do I detect if my program runs in an Active Directory environment?

前端 未结 5 494
陌清茗
陌清茗 2020-12-31 16:51

How do I detect if my program runs in an Active Directory environment?

I\'m using C# and .Net 2.0

5条回答
  •  清酒与你
    2020-12-31 17:22

    I found something that works:

    using System.Net.NetworkInformation;

    IPGlobalProperties.GetIPGlobalProperties().DomainName;

    Works with a local user and a domain user.

提交回复
热议问题