网页功能: 加入收藏 设为首页 网站搜索  
创建虚拟目录
发表日期:2003-03-04作者:摘自互联网[] 出处:  

'''''''''''''''''''''''''''''''''

Option Explicit

On Error Resume Next

'''''''''''''''''''''''

' First, open the path to the Web server you are

' trying to add a virtual directory to.

function CreateVirtualDir()

Dim ServObj

Dim VdirObj

Dim Testpath

Set ServObj = GetObject("IIS://LocalHost/w3svc/1/Root")

if (Err <>0) then

  debug.print "GetObject (""IIS://LocalHost/w3svc/1/Root"") Failed! <br>"

  debug.print "Error! " & Err.Number & "(" & Hex(Err.Number) & "): " & Err.Description & "<br>"

  exit function

end if

'''''''''''''''''''''''

' Second, Create the virtual directory (Vdir) path

Set VdirObj = ServObj.Create("IIsWebVirtualDir", "MyVdir")

VdirObj.SetInfo

if (Err<>0) then

  debug.print "CreateObject(""IIS://LocalHost/w3svc/1/Root/MyVdir"") Failed!"

  debug.print "Error! " & Err.Number & "(" & Hex (Err.Number) & "): " & Err.Description &

  exit function

end if

''''''''''''''''''''''''

' Finally, create a Path variable containing the virtual root path and

' set the permissions to read, script, and directory browsing

VdirObj.AccessRead = True

VdirObj.AccessScript = True

VdirObj.EnableDirBrowsing = True

Testpath = "C:\Temp"

VdirObj.Put "Path", (Testpath)

VdirObj.SetInfo

if (Err<> 0) then

  debug.print "Put (""Path"") Failed!"

  debug.print "Error! " & Err.Number & "(" & Hex (Err.Number) & "): " & Err.Description &

else

  debug.print "VDIR successfully created"

end if

''''''''''''''''''''''''

' The minimum amount necessary to create a virtual directory has now

' been completed. If you need to add more, do it here.

end function

我来说两句】 【加入收藏】 【返加顶部】 【打印本页】 【关闭窗口
中搜索 创建虚拟目录
本类热点文章
  ASP获得网卡的MAC地址
  默认点击下载pdf等文件而不是在浏览器中..
  纯ASP结合VML生成完美图-折线图
  利用ASP实现事务处理的方法
  ASP的分页函数
  ASP的分页函数
  ASP开发中遇到的错误信息中文说明大全
  ASP连接11种数据库语法总结
  ASP操作Excel技术总结
  酷月历(公、农历)
  酷月历(公、农历)
  用InstallShield打包ASP程序
最新分类信息我要发布 
最新招聘信息

关于我们 / 合作推广 / 给我留言 / 版权举报 / 意见建议 / 广告投放  
Copyright ©2003-2024 Lihuasoft.net webmaster(at)lihuasoft.net
网站编程QQ群   京ICP备05001064号 页面生成时间:0.00411