One question about how to create IIsWebVirtualDir in vb.Net ?
My code:
Dim objDirEnt As DirectoryEntry = New DirectoryEntry
("IIS://localhost/W3SVC/1/Root")
Dim ChildEnt As DirectoryEntry
objDirEnt.UsePropertyCache = True
Dim objChild As DirectoryEntry = objDirEnt.Children.Add
("TestDir", "IIsWebVirtualDir")
objChild.CommitChanges()
objChild.Properties("Path")(0) = "C:\Inetpub\wwwroot"
objChild.Properties("AccessWrite")(0) = False
objChild.Properties("AccessRead")(0) = True
objChild.Properties("ContentIndexed")(0) = False
objChild.Properties("EnableDefaultDoc")(0) = True
objChild.Properties("AccessScript")(0) = True
objChild.Properties("KeyType")(0) = "IIsWebVirtualDir"
objChild.Properties("EnableDirBrowsing")(0) = False
objChild.Properties("AppFriendlyName")(0) = Name
objChild.Invoke("AppCreate", True)
objChild.CommitChanges()
End Sub
ˇ·My Problem is the TestDir is not empty. it contains much defult
VirtualDir why? Could someone tell Me How to do? Thanks