来源:网络 | 2007-3-30 | (有5289人读过)
Part I - 遍历目录: ’-------------------------------- Dim Mypath,MyfileName Mypath="c:\" MyfileName=Dir(Mypath,vbDirectory)’包括文件夹在内的c:\所有的内容 Do while MyfileName <>"" If (GetAttr(Mypath & MyfileName) And vbDirectory) = vbDirectory Then If MyfileName = "XX" Then End Else ’创建XX文件夹 End If End If MyfileName = Dir ’通过这个赋值,实现do while的循环。 Loop
Part II - 开始创建 - 逐级: Dim IIsObjectPath Dim IIsObject Dim vroot Dim vdir IIsObjectPath = server + "/W3SVC/" + 1 Set IIsObject = GetObject(IIsObjectPath) Set vroot = IIsObject.GetObject("IIsWebVirtualDir", "Root") Set vdir = vroot.Create("IIsWebVirtualDir", "XX")
|