久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何獲取來賓/管理員的本地組名稱?

How can I get the local group name for guests/administrators?(如何獲取來賓/管理員的本地組名稱?)
本文介紹了如何獲取來賓/管理員的本地組名稱?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

問題:

我使用在以下位置找到的代碼http://support.microsoft.com/kb/306273

I use the code found at http://support.microsoft.com/kb/306273

添加一個windows用戶.問題是我需要將用戶添加到組中,但組名已本地化.

to add a windows user. The problem is i need to add the user to a group, but the groupnames are localized.

例如MS-example 使用英文計算機,這意味著您可以像這樣獲得來賓組:

E.g. the MS-example uses an english computer, which means you can get the guest group like this:

grp = AD.Children.Find("Guests", "group")

但在非英語計算機上,Guest"組名是本地化的,例如,在我的德語操作系統上,Guest 的組名是G?ste".

But on a non-english computer, the 'Guest' groupname is localized, meaning for example on my german language OS, the group name for Guests is "G?ste".

這意味著要在我的計算機上運行支持示例,我需要將該行更改為

Which means for the support example to run on my computer i need to change that line to

grp = AD.Children.Find("G?ste", "group")

然后就可以了.

現在如果操作系統是任何其他語言,我如何找到來賓用戶的名稱?或者如何從 sid 獲取來賓用戶名?

Now if the OS is any other language, how can I find the name for the guest user ? Or how can i get the guest user name from a sid ?

注意:.NET 2.0,而不是 3.0 或 3.5

Note: .NET 2.0, not 3.0 or 3.5

推薦答案

正如您所指出的,組的名稱根據系統語言進行了本地化.

As you have pointed out, the names of groups are localised depending on system language.

對于像管理員"和訪客"這樣的知名"組,您應該根據 SID 進行檢索.來賓的 SID 是:

For 'well known' groups like 'Administrators' and 'Guests' you should retrieve based on the SID. The SID for Guests is:

S-1-5-32-546

這里有一個眾所周知的 SID 列表:

There is a list of well known SIDs here:

http://support.microsoft.com/kb/243330

可以找到從 SID 獲取組名的代碼 這里

Code to get the group name from the SID can be found here

這篇關于如何獲取來賓/管理員的本地組名稱?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why shouldn#39;t I always use nullable types in C#(為什么我不應該總是在 C# 中使用可空類型)
C# HasValue vs !=null(C# HasValue vs !=null)
C# ADO.NET: nulls and DbNull -- is there more efficient syntax?(C# ADO.NET:空值和 DbNull —— 有沒有更高效的語法?)
How to set null value to int in c#?(如何在c#中將空值設置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Method call if not null in C#(在 C# 中如果不為 null 的方法調用)
主站蜘蛛池模板: 国产精品成人在线播放 | 欧美激情啪啪 | 99只有精品 | 成人a视频片观看免费 | 国产91久久精品一区二区 | 日韩精品一区二区三区中文字幕 | 国产精品毛片 | 欧美视频在线看 | 久久久亚洲一区 | 国产四区| 午夜精品一区二区三区在线观看 | 精品中文字幕在线 | 特级黄一级播放 | 国产成人99久久亚洲综合精品 | 中日av| 国产精品国产a级 | 亚洲国产一区二区三区 | 美女黄色在线观看 | 国产电影一区 | www.亚洲视频.com | 噜噜噜噜狠狠狠7777视频 | 精品乱码久久久久 | 国产一级免费视频 | 成人在线免费视频 | 无码一区二区三区视频 | 免费在线a视频 | 成人免费xxxxx在线视频 | 精品一二区 | 激情欧美一区二区三区中文字幕 | 欧美一区 | 男女精品久久 | 国产在线网址 | 激情网五月天 | 欧美日韩美女 | 91免费福利在线 | 国产福利资源在线 | 中文视频在线 | 欧美成人在线影院 | 日韩在线小视频 | 在线看一区二区三区 | 国产97视频在线观看 |