Create Virtual Directory

tarzan_055

New member
Joined
Mar 22, 2012
Messages
1
Programming Experience
3-5
Dear All

I am using this code to create a virtual directory on IIS7 and it works fine.

Dim VDir As System.DirectoryServices.DirectoryEntry = IISAdmin.Children.Add(AppName, "IIsWebVirtualDir")
VDir.Properties("Path").Item(0) = Path
VDir.Properties("AppFriendlyName").Item(0) = AppName
VDir.Properties("EnableDirBrowsing").Item(0) = False
VDir.Properties("AccessRead").Item(0) = True
VDir.Properties("AccessExecute").Item(0) = True
VDir.Properties("AccessWrite").Item(0) = False
VDir.Properties("AccessScript").Item(0) = True
VDir.Properties("AuthNTLM").Item(0) = True
VDir.Properties("EnableDefaultDoc").Item(0) = True
VDir.Properties("DefaultDoc").Item(0) = "default.htm,default.aspx,default.asp,index.php"
VDir.Properties("AspEnableParentPaths").Item(0) = True
VDir.CommitChanges()
VDir.Invoke("AppCreate", 1)


Ofcourse this block is part of other code. the only problem that i am face is the propertie to add "Physical Path Credentials" and password to the virtual directory. i already tried
VDir.Properties("UserName").Item(0) = UserName
VDir.Properties("password").Item(0) = Password

but it does not work.
Regards to all
 
Back
Top