天天看點

IIS動态建立虛拟目錄(轉)

DirectoryEntry de = rootfolder.Children.Find("Aspcn","IIsVirtualDir"); 

 de.Invoke("AppDelete",true); 

 rootfolder.CommitChanges();      
object[] paras = new object[2]; 

 paras[0] = "IIsWebVirtualDir"; //表示操作的是虛拟目錄 

 paras[1] = "Aspcn"; 

 rootfolder.Invoke("Delete",paras); 

 rootfolder.CommitChanges();