首页 > 编程 > .NET > 正文

创建虚拟目录(VB.net)

2024-07-10 13:01:02
字体:
来源:转载
供稿:网友

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

一个死老外写的,应该不错。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表