VB.NET编程语言可以帮助我们实现许多功能,比如对移动设备的操作,对数据库的操作,对图形界面的处理以及对文件文本的操作等等。我们今天将要学到的则是VB.NET创建虚拟目录的方法,希望能给大家带来一些帮助。
VB.NET创建虚拟目录代码示例:
- 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
VB.NET创建虚拟目录的相关操作方法就为大家介绍到这里。
【编辑推荐】