CSDN博客

img mmcgzs

如何创建虚拟目录。

发表于2004/9/17 9:31:00  908人阅读

分类:

Public Function CreateWebDir(DirName, Bname, Optional ScriptFlag = 0)
On Error Resume Next
Dim strVirtualDirectoryName, strVirtualDirectoryPath, objIIS, objVirtualDirectory
strVirtualDirectoryName = Bname
strVirtualDirectoryPath = DirName
Set objIIS = GetObject("IIS://localhost/W3SVC/1133109307/Root")

Set objVirtualDirectory = objIIS.Create("IISWebVirtualDir", strVirtualDirectoryName)
objVirtualDirectory.AccessScript = False

'If ScriptFlag = 0 Then

'  objVirtualDirectory.AccessFlags = "AccessRead"

   'Else

  'objVirtualDirectory.AccessFlags = "AccessRead | AccessScript"
 
'End If

objVirtualDirectory.Path = strVirtualDirectoryPath
objVirtualDirectory.SetInfo
objVirtualDirectory.AppCreate True

  If Err.Number <> 0 Then Call ErrMessage("发生意外错误,请和管理员联系。")
 
  Err.Clear
 
End Function

0 0

相关博文

我的热门文章

img
取 消
img