Machine's domain name in .NET?

前端 未结 6 1014
小蘑菇
小蘑菇 2021-02-03 22:47

There gotta be an easy way to do this, I can\'t believe there\'s none. I have scanned through net and found, like, 20 different methods to find in which domain current user is,

6条回答
  •  忘了有多久
    2021-02-03 23:17

    If you don't want to add a dependency to System.DirectoryServices, you can also call the NetGetJoinInformation API directly.

提交回复
热议问题