June 22nd, 2009, 11:23 AM
Create local folder using WMI, C#.net
I've been googling for about an hour now and am still have some problems. I want to be able to create a folder on my (local) computer using C# and then set permissions for it. Any ideas?
June 22nd, 2009, 11:59 AM
You need to set ACL's programmatically?
Also be sure and have a look at the "FileIOPermission" MSDN help topic, as well as "requesting permissions" and how to use permview.exe.
Declaring these permissions is a way to make .NET apps easier to administer; the assembly manifest will contain information regarding the required filesystem/network access.
An admin can use permview on the assembly in order to determine proper network and file permissions needed by the app.
Last edited by MadDogBrown; June 22nd, 2009 at 12:04 PM.
June 22nd, 2009, 01:14 PM
I'm curious as to the 'why' of this. .Net provides a number of ways for reading and writing to files within the existing accepted file systems standards. What are you trying to do? Perhaps there is a more-correct way to do it.
To create a folder using C#
first include the IO : using System.IO
then put this code in a button or whatever you want
string path = "type your path here " ;