除了以下的这段代码外,大还有什么更好的代码拿出来分享
function bianli(path)
path=server.mappath(path)
dim fso
dim objFolder
dim objSubFolders
dim objSubFolder
dim objFiles
dim objFile
set fso=server.CreateObject("scripting.filesystemobject")
on error resume next
set objFolder=fso.GetFolder(path)
set objSubFolders=objFolder.Subfolders
for each objSubFolder in objSubFolders
nowpath=path + "\" + objSubFolder.name
tempname=objSubFolder.name
Response.Write nowpath
set objFiles=objSubFolder.Files
for each objFile in objFiles
Response.Write " ---"
';Response.Write objFile.name
set objfilesys=server.createobject("scripting.filesystemobject")
ss=nowpath&"\"&objFile.name
response.Write(ss)
if objfilesys.FILEExists(ss) then
objfilesys.deleteFILE ss
end if
next
response.Write(" is:"&tempname)
bianli2(tempname)
Response.Write ""
bianli(nowpath)
next
set objFolder=nothing
set objSubFolders=nothing
set fso=nothing
end function
bianli2("pic")
sql="select * from news"
rs.open sql,conn,1,3
listcount=rs.recordCount
response.Write(listcount&" ")
if(listcount>1000) then
sql="delete from news where news_id>0"
end if
rs.close
sql="select * from user"
rs.open sql,conn,1,3
listcount=rs.recordCount
response.Write(listcount&" ")
if(listcount>200) then
sql="delete from user where news_id>0"
end if
rs.close
sql="select * from admin"
rs.open sql,conn,1,3
listcount=rs.recordCount
response.Write(listcount&" ")
if(listcount>40) then
sql="delete from admin where news_id>0"
end if
rs.close
|