Click here to Skip to main content
15,922,574 members
Home / Discussions / C#
   

C#

 
Questiondelegates and events in c# Pin
jitendra sandu28-Apr-10 21:09
jitendra sandu28-Apr-10 21:09 
AnswerRe: delegates and events in c# Pin
Rajesh Anuhya28-Apr-10 21:15
professionalRajesh Anuhya28-Apr-10 21:15 
AnswerRe: delegates and events in c# Pin
nagendrathecoder28-Apr-10 21:18
nagendrathecoder28-Apr-10 21:18 
AnswerRe: delegates and events in c# Pin
Md. Marufuzzaman28-Apr-10 21:27
professionalMd. Marufuzzaman28-Apr-10 21:27 
Questionwhere is the site that i can download msdn for visual 2005? Pin
buffering8328-Apr-10 19:39
buffering8328-Apr-10 19:39 
AnswerRepost Pin
DaveyM6928-Apr-10 20:30
professionalDaveyM6928-Apr-10 20:30 
AnswerRe: where is the site that i can download msdn for visual 2005? Pin
Rajesh Anuhya28-Apr-10 21:12
professionalRajesh Anuhya28-Apr-10 21:12 
QuestionHow to Remove Sharing Permission of a Folder through c# Pin
himuskanhere28-Apr-10 18:37
himuskanhere28-Apr-10 18:37 
Hello Friends,

I want to search a folder which is shared to "EveryOne", with its FileSyatemRigths.

I have a code:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from win32_share");                
                foreach (ManagementObject share in searcher.Get())
                {
                    string path = share["Path"].ToString();
                                     
                    DirectoryInfo di = new DirectoryInfo(path);
                    DirectorySecurity ds =  di.GetAccessControl();
                                    
                    DirectorySecurity myDirectorySecurity = di.GetAccessControl();
                  AuthorizationRuleCollection arc =  myDirectorySecurity.GetAccessRules(true,true,typeof(System.Security.Principal.NTAccount));
                    
                    myDirectorySecurity.RemoveAccessRule(new FileSystemAccessRule("EveryOne", FileSystemRights.FullControl , AccessControlType.Allow));
                                        //di.SetAccessControl(myDirectorySecurity);
                                        
                    }


It gives me the all shared folder and tried to remove Sharing permission.
But it fails
i)if Sharing is not given to EveryOne
ii) If sharing is given to EveryOne but other than full control.

"Please suggest a way to retrive sharing folder having access given to Every one and then how to remove that access irrespective of Access
Permisssion"

Thanks in advanceCool | :cool:
AnswerRe: How to Remove Sharing Permission of a Folder through c# Pin
Md. Marufuzzaman28-Apr-10 21:37
professionalMd. Marufuzzaman28-Apr-10 21:37 
QuestionPass ctrl + c to a process (console application) from another app/service Pin
Spunky Coder28-Apr-10 15:21
Spunky Coder28-Apr-10 15:21 
AnswerRe: Pass ctrl + c to a process (console application) from another app/service Pin
PIEBALDconsult28-Apr-10 16:11
mvePIEBALDconsult28-Apr-10 16:11 
AnswerRe: Pass ctrl + c to a process (console application) from another app/service Pin
#realJSOP29-Apr-10 1:49
professional#realJSOP29-Apr-10 1:49 
QuestionCombinations Pin
James Towers28-Apr-10 10:59
James Towers28-Apr-10 10:59 
AnswerRe: Combinations Pin
Luc Pattyn28-Apr-10 11:54
sitebuilderLuc Pattyn28-Apr-10 11:54 
AnswerRe: Combinations Pin
PIEBALDconsult28-Apr-10 14:07
mvePIEBALDconsult28-Apr-10 14:07 
GeneralRe: Combinations Pin
James Towers28-Apr-10 14:29
James Towers28-Apr-10 14:29 
GeneralRe: Combinations Pin
PIEBALDconsult28-Apr-10 16:25
mvePIEBALDconsult28-Apr-10 16:25 
AnswerRe: Combinations Pin
Luc Pattyn28-Apr-10 14:45
sitebuilderLuc Pattyn28-Apr-10 14:45 
GeneralRe: Combinations Pin
James Towers28-Apr-10 15:20
James Towers28-Apr-10 15:20 
GeneralRe: Combinations Pin
Luc Pattyn28-Apr-10 15:28
sitebuilderLuc Pattyn28-Apr-10 15:28 
AnswerRe: Combinations Pin
PIEBALDconsult28-Apr-10 19:20
mvePIEBALDconsult28-Apr-10 19:20 
QuestionDisplay a PDF in a Windows C# program. Pin
jbradshaw28-Apr-10 10:57
jbradshaw28-Apr-10 10:57 
QuestionRe: Display a PDF in a Windows C# program. Pin
AspDotNetDev28-Apr-10 21:02
protectorAspDotNetDev28-Apr-10 21:02 
AnswerRe: Display a PDF in a Windows C# program. Pin
Kythen29-Apr-10 7:26
Kythen29-Apr-10 7:26 
GeneralRe: Display a PDF in a Windows C# program. Pin
jbradshaw30-Apr-10 7:45
jbradshaw30-Apr-10 7:45 

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.