编程语言

img iwebsms

创建虚拟目录(VB.net)

发表于2004/11/2 23:31:00  1649人阅读

    Function CriaDiretorioVirtual(ByVal vdirname As String, ByVal serverID As String, ByVal vdirPath As String, ByVal criaApplication As Boolean) As DirectoryEntry

        Dim newvdir As DirectoryEntry

        Dim root As DirectoryEntry

 

        root = New DirectoryEntry("IIS://localhost/W3SVC/" + serverID + "/Root")

 

        newvdir = root.Children.Add(vdirname, "IIsWebVirtualDir")

        newvdir.Properties("Path")(0) = vdirPath

 

        If criaApplication Then

            newvdir.Invoke("AppCreate", True)

            newvdir.Properties("AppFriendlyName")(0) = vdirname

            newvdir.Properties("AppIsolated")(0) = 2

        End If

        newvdir.CommitChanges()

 

        Return newvdir

    End Function

一个死老外写的,应该不错。
阅读全文
0 0

相关文章推荐

img
取 消
img