45fan.com - 路饭网

搜索: 您的位置主页 > 网络频道 > 阅读资讯:创建虚拟目录的步骤

创建虚拟目录的步骤

2016-09-03 12:07:46 来源:www.45fan.com 【

创建虚拟目录的步骤

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

一个死老外写的,应该不错。
 

本文地址:http://www.45fan.com/a/question/71769.html
Tags: 创建 目录 VB.NET
编辑:路饭网
关于我们 | 联系我们 | 友情链接 | 网站地图 | Sitemap | App | 返回顶部