用C#代码在IIS7中为创建的虚拟目录设置属性,求指教。
我想使用IIS7的Microsoft.Web.Administration这个API来为虚拟目录设置属性,完全不使用IIS6中的类来完成是否可行?就是像下面的代码中的属性,在IIS7中是否有方法来设置?还有是否可以通过WMI来完成虚拟目录属性的设置?
newvdir.Properties["Path"][0] = _installDir; //Local path
newvdir.Properties["AccessSource"][0] = false; //Script source access
newvdir.Properties["AccessRead"][0] = true; //Read
newvdir.Properties["AccessWrite"][0] = false; //Write
newvdir.Properties["EnableDirBrowsing"][0] = false; //Directory browsing
求大神帮助一下,谢谢了!