Click here to Skip to main content
15,888,325 members
Home / Discussions / C#
   

C#

 
QuestionHow do I get a list of all windows user groups Pin
sneezesnoeze16-Jun-14 22:48
sneezesnoeze16-Jun-14 22:48 
AnswerRe: How do I get a list of all windows user groups Pin
Eddy Vluggen17-Jun-14 3:03
professionalEddy Vluggen17-Jun-14 3:03 
GeneralRe: How do I get a list of all windows user groups Pin
sneezesnoeze17-Jun-14 8:02
sneezesnoeze17-Jun-14 8:02 
GeneralRe: How do I get a list of all windows user groups Pin
Eddy Vluggen17-Jun-14 8:08
professionalEddy Vluggen17-Jun-14 8:08 
GeneralRe: How do I get a list of all windows user groups Pin
sneezesnoeze17-Jun-14 10:59
sneezesnoeze17-Jun-14 10:59 
GeneralRe: How do I get a list of all windows user groups Pin
Eddy Vluggen17-Jun-14 11:09
professionalEddy Vluggen17-Jun-14 11:09 
GeneralRe: How do I get a list of all windows user groups Pin
Pete O'Hanlon17-Jun-14 11:47
mvePete O'Hanlon17-Jun-14 11:47 
AnswerRe: How do I get a list of all windows user groups Pin
Yonatan Arbel20-Jun-14 2:51
Yonatan Arbel20-Jun-14 2:51 
Well,
try this function :


C#
static public void directoryInfo()
        {

            var di = new DirectoryInfo(@"\\server\shared\Alignment_Meeting"); //this is an example path ( you can assign it to some text box for exmaple that the user will enter the path he'd like to get info about. 
 
            foreach (DirectoryInfo dir in di.GetDirectories())
            {
                Console.Write(dir.FullName + "\n");
                DirectorySecurity ds = dir.GetAccessControl(AccessControlSections.Access);
                foreach (FileSystemAccessRule fsar in ds.GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount)))
                {
                    string userName = fsar.IdentityReference.Value;
                    string userRights = fsar.FileSystemRights.ToString();
                    string userAccessType = fsar.AccessControlType.ToString();
                    string ruleSource = fsar.IsInherited ? "Inherited" : "Explicit";
                    string rulePropagation = fsar.PropagationFlags.ToString();
                    string ruleInheritance = fsar.InheritanceFlags.ToString();
                    Console.Write(userName + " : " + userAccessType + " : " + userRights + " : " + ruleSource + " : " + rulePropagation + " : " + ruleInheritance + "<br/>");
                }
            }
        } //directory info method

Yonatan Arbel -

AnswerRe: How do I get a list of all windows user groups Pin
Nathan Minier20-Jun-14 3:08
professionalNathan Minier20-Jun-14 3:08 
QuestionC# Windows Forms App Pin
Zeyad Jalil16-Jun-14 19:33
professionalZeyad Jalil16-Jun-14 19:33 
AnswerRe: C# Windows Forms App Pin
Eddy Vluggen17-Jun-14 7:15
professionalEddy Vluggen17-Jun-14 7:15 
AnswerRe: C# Windows Forms App Pin
Swinkaran17-Jun-14 13:39
professionalSwinkaran17-Jun-14 13:39 
Question[Wp8.1] How to save the RenderTargetBitmap to png? Pin
Lãng Khách15-Jun-14 23:08
Lãng Khách15-Jun-14 23:08 
AnswerRe: [Wp8.1] How to save the RenderTargetBitmap to png? Pin
BobJanova16-Jun-14 0:34
BobJanova16-Jun-14 0:34 
GeneralRe: [Wp8.1] How to save the RenderTargetBitmap to png? Pin
Lãng Khách16-Jun-14 1:17
Lãng Khách16-Jun-14 1:17 
Questionc# - duplicate tabpage Pin
Member 1026763014-Jun-14 22:46
Member 1026763014-Jun-14 22:46 
AnswerRe: c# - duplicate tabpage Pin
OriginalGriff14-Jun-14 23:40
mveOriginalGriff14-Jun-14 23:40 
Questioni set combobox data source value and cleare item also but just add a new item combo list is add new list in old list my code is Pin
Member 1066930114-Jun-14 21:11
Member 1066930114-Jun-14 21:11 
AnswerRe: i set combobox data source value and cleare item also but just add a new item combo list is add new list in old list my code is Pin
OriginalGriff14-Jun-14 21:51
mveOriginalGriff14-Jun-14 21:51 
GeneralRe: i set combobox data source value and cleare item also but just add a new item combo list is add new list in old list my code is Pin
Member 1066930114-Jun-14 23:08
Member 1066930114-Jun-14 23:08 
GeneralRe: i set combobox data source value and cleare item also but just add a new item combo list is add new list in old list my code is Pin
OriginalGriff14-Jun-14 23:39
mveOriginalGriff14-Jun-14 23:39 
GeneralRe: Not Refresh combo box item list Or Just say Not clear itemlist Pin
Member 1066930115-Jun-14 0:17
Member 1066930115-Jun-14 0:17 
GeneralRe: Not Refresh combo box item list Or Just say Not clear itemlist PinPopular
Mycroft Holmes15-Jun-14 0:22
professionalMycroft Holmes15-Jun-14 0:22 
GeneralRe: Not Refresh combo box item list Or Just say Not clear itemlist Pin
Member 1066930115-Jun-14 1:00
Member 1066930115-Jun-14 1:00 
GeneralRe: Not Refresh combo box item list Or Just say Not clear itemlist Pin
OriginalGriff15-Jun-14 1:07
mveOriginalGriff15-Jun-14 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.