28,408
社区成员
发帖
与我相关
我的任务
分享
Sub createDir(dirName)
dirName=Server.MapPath(dirName)
set fso=Server.CreateObject("scripting.filesystemobject")
if not fso.folderexists(dirName) then'不存在的时候
set dir=fso.createfolder(dirName)'创建总目录
end if
'fso.close
set fso=nothing
End Sub
call createDir("../html/")
call createDir("../html/news/")
call createDir("../html/news/ceshi11/")
HtmlSave "http://"&Application(CacheName&"_WebSetting")(6)&"/news.asp?id="&id,"../html/news/ceshi11/"&id&".htm" '生成html开始
Public Function CheckPath(physicalPath)
Dim fso,arrPhysicalPath,i,strPath
Set fso = CreateObject("Scripting.FileSystemObject")
arrPhysicalPath = Split(physicalPath,"\")
strPath = ""
For i=0 To Ubound(arrPhysicalPath)
If arrPhysicalPath(i)&""<>"" Then
strPath = strPath&arrPhysicalPath(i)&"\"
If Not fso.FolderExists(strPath) Then
'Response.Write("errr")
fso.CreateFolder(strPath)
End If
End If
Next
Set fso = Nothing
End Function
call CheckPath(Server.MapPath("../html/news/ceshi11/"))
HtmlSave "http://"&Application(CacheName&"_WebSetting")(6)&"/news.asp?id="&id,"../html/news/ceshi11/"&id&".htm" '生成html开始
'检查路径不存在就创建
Public Function CheckPath(physicalPath)
Dim fso,arrPhysicalPath,i,strPath
Set fso = CreateObject("Scripting.FileSystemObject")
arrPhysicalPath = Split(physicalPath,"\")
strPath = ""
For i=0 To Ubound(arrPhysicalPath)
If arrPhysicalPath(i)&""<>"" Then
strPath = strPath&arrPhysicalPath(i)&"\"
If Not fso.FolderExists(strPath) Then
'Response.Write("errr")
fso.CreateFolder(strPath)
End If
End If
Next
Set fso = Nothing
End Function
Sub createDir(dirName)
dirName=Server.MapPath(dirName)
set fso=Server.CreateObject("scripting.filesystemobject")
if not fso.folderexists(dirName) then'不存在的时候
set dir=fso.createfolder(dirName)'创建总目录
end if
'fso.close
set fso=nothing
End Sub
'//你直接调用这个过程即可