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

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

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

問題描述

問題:

我使用在以下位置找到的代碼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"組名是本地化的,例如,在我的德語操作系統(tǒng)上,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")

然后就可以了.

現(xiàn)在如果操作系統(tǒng)是任何其他語言,我如何找到來賓用戶的名稱?或者如何從 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

推薦答案

正如您所指出的,組的名稱根據(jù)系統(tǒng)語言進行了本地化.

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

對于像管理員"和訪客"這樣的知名"組,您應(yīng)該根據(jù) 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

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

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

相關(guān)文檔推薦

Why shouldn#39;t I always use nullable types in C#(為什么我不應(yīng)該總是在 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#中將空值設(shè)置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Method call if not null in C#(在 C# 中如果不為 null 的方法調(diào)用)
主站蜘蛛池模板: 999久久久| 亚洲成av | 精久久久久 | 久久激情视频 | 成人日韩精品 | 狠狠狠色丁香婷婷综合久久五月 | 欧美一级欧美一级在线播放 | 欧美成人在线影院 | 国产午夜久久久 | 久久久久久久一区二区三区 | 2018国产大陆天天弄 | www.国产| 91精品一区| 成人av激情 | 成人无遮挡毛片免费看 | 91久久| 天天干夜夜操 | 国产美女精品 | 国产高清一区二区三区 | 玖玖精品视频 | 日日夜夜精品视频 | 天天综合久久网 | 四虎影音 | 国产在线观看网站 | 一区二区三区中文字幕 | 中文字幕一区在线 | 在线成人免费视频 | 男人天堂社区 | 激情五月综合 | 精品av久久久久电影 | 午夜视频一区 | 欧美一区二区三区在线观看 | 国产无套一区二区三区久久 | 日韩一二三区 | 久久久国产一区 | 欧美日韩黄 | 国产激情在线播放 | 久久久久网站 | 中文字幕日韩欧美一区二区三区 | 国产一区二区三区网站 | 涩涩鲁亚洲精品一区二区 |