How to create a new folder & give permission in Silverlight 4
I need to create a new sub folder say 'MyNewFolder' under My Documents.
I also need to grant permission my application or even everyone to read/write in 'MyNewFolder' folder.
I'm on OOB & elevated trust
How do I create a new folder & at the same time g开发者_如何学编程ive permission to everyone to read/write on the new folder ?
You can create a sub folder in My Documents with this code:-
DirectoryInfo di = new DirectoryInfo(Environment.GetFolderPath(SpecialFolder.MyDocuments));
myDocs.CreateSubDirectory("MyNewFolder");
However you are not able to manipulate the folder's ACL hence you cannot make it available to everyone.
If you need to create a file which is available to everyone you will need to invoke the SaveFileDialog box and have the user specify a file location which has the appropriate security.
精彩评论