创建虚拟目录(VB.net)
来源:岁月联盟
时间:2004-11-08
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
一个死老外写的,应该不错。
上一篇:把aspx文件编译成DLL文件
下一篇:几个C#编程的小技巧 (二)