Hi Matt ,
If you want to configure the DACL of the directory to allow everyone on
your machine to full control this folder, then you are looking at the
correct parameter. The "DirectorySecurity Class" below contains the sample
code regarding how to setup the DirectorySecurity object:
http://msdn2.microsoft.com/en-us/library/system.security.accesscontrol.direc
torysecurity.aspx
The link below also contains some ACL programming stuff:
"How To Program ACLs"
http://pluralsight.com/wiki/default.aspx/Keith.GuideBook/HowToProgramACLs.ht
ml
However, if you want to share this directory with others from remote
computer through LAN file share, there is another story.
In file share, there are 2 stages of access check: DACL access check and
file share permission check. Only account authentication can pass these 2
permission sets stages, can it successfully access the shared files.
Sharing Permission set can be configured through "Permissions" button in
"Sharing" tabpage in folder property dialog, while NTFS DACL Permission set
can be configured through button in "Security" tabpage in folder property
dialog.
..Net contains build-in support to configure the DACL permission of
directories/files and I have shown you the sample code snippet in the first
paragraph. To configure the share permission, there is no build-in support.
We have to p/invoke NetUseAdd Win32 API for this task. My original reply
below and the codeproject article demonstrates this idea with code snippet
in C#:
http://groups.google.com/group/microsoft.public.platformsdk.security/msg/063
d7b08b29e5642?hl=zh-CN&
"How to create a file share using .NET framework"
http://www.codeproject.com/dotnet/pinvokeaddshare.asp
Finally, the article below contains very detaild ACL programming in
..Net2.0, it should be informative if you are curious about security
programming in .Net:
http://www.codeproject.com/csharp/accessctrl3.asp
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.