开发者

How to create a new folder & give permission in Silverlight 4

开发者 https://www.devze.com 2023-04-11 09:42 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号