I want to create a folder in either My Documents or the Public\Users folders on XP and Vista.
I can create the folder using Directory.CreateDirectory without any problem. However, it defaults to ReadOnly.
I've tried using the DirectorySecurity overload but cannot get it to work.
When I try the AddDirectorySecurity method, I get teh error message "AddDirectorySecurity" is not declared.
If I change to DirectorySecurity (as suggested by Visual Studio) I am told it is " a type and cannot be used as an expression.
Can someone point me in the right direction please?
Public Class MyClass
If Directory.Exists(fullPath.ToString()) = False Then
AddDirectorySecurity(fullPath.ToString()), "DOMAIN\MyUser", FileSystemRights.WriteData, AccessControlType.Allow)
Catch ex As Exception