asp 由动态网页转变为静态网页的实现代码(4)


function FSOCreateDIR(LocalPath)
dim patharr,path_level,i,pathtmp,cpath,CreateDIR,FileObject
on error resume next
LocalPath = Server.MapPath(LocalPath)
LocalPath = replace(LocalPath,"\","/")
set FileObject = server.createobject("Scripting.FileSystemObject")
patharr = split(LocalPath,"/")
path_level = ubound(patharr)
for i = 0 to path_level
if i=0 then pathtmp = patharr(0) & "/" else pathtmp = pathtmp & patharr(i) & "/"
cpath = left(pathtmp,len(pathtmp)-1)
if not FileObject.FolderExists(cpath) then FileObject.CreateFolder(cpath)
next
set FileObject = nothing
if err.number<>0 then
CreateDIR = false
err.Clear
else
CreateDIR = true
end if
end function
%>

3.在后台添加生成静态新闻链接
复制代码 代码如下:

<TD height=20 align="center"><a href="../admin_product/saveaddnews.asp?action=htmlall" target="ggdlab">生成新闻静态</a></TD>

来源于我的博客
http://blog.csdn.net/lingfeng179