Hi,
I am using Visual Studio 2008, C#. I am trying to create Virtual Directory on Windows Server 2008. My function works fine - create a virtual directory on the user's local machine in FTP site. Inside function I have code:
DirectoryEntry Dir = new DirectoryEntry(Path);
.....
.....
// Create Virstual directory
objNewDirectory.Invoke("AppCreate", true);
// Assign property to Virtual directory
NewDirectory.Properties["EnableDirBrowsing"][0] =HasBrowseAccess;
NewDirectory.Properties["AccessExecute"][0] = HasExecuteAccess;
NewDirectory.Properties["AccessRead"][0] = HasReadAccess;
NewDirectory.Properties["AccessWrite"][0] = HasWriteAccess;
NewDirectory.Properties["AuthAnonymous"][0] = IsAnonymousAccessAllow;
NewDirectory.Properties["AuthBasic"][0] = IsBasicAuthenticationSet;
NewDirectory.Properties["AuthNTLM"][0] = IsNTLMAuthenticationSet;
It doesn't work in IIS7. Is it possible to create Virtual Directory and add this permissions programmatically? Can you please give me an example? Thanks.