How to create a virtual directory.

xiaoxiao2021-03-06  49

Public Function CreateWebDir (DirName, Bname, Optional ScriptFlag = 0) On Error Resume NextDim strVirtualDirectoryName, strVirtualDirectoryPath, objIIS, objVirtualDirectorystrVirtualDirectoryName = BnamestrVirtualDirectoryPath = DirNameSet 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 = strvirtualdirectorypathobjvirtualdirectory.setinfoobjvirtualdirectory.Appcreate true

If Err.Number <> 0 THEN CALL ERRMESSAGE ("accidental error, please contact the administrator.") Err.clear End Function

转载请注明原文地址:https://www.9cbs.com/read-116092.html

New Post(0)