p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asptoday_discuss thread: How to create IIsWebVirtualDir in vb.Net


Message #1 by a844001@m... on Thu, 6 Sep 2001 01:59:21
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

  Return to Index