程序员

asp目录读写权限检测脚本 TestFolder

作者:admin 2021-05-06 我要评论

效果图: 复制代码 代码如下: % 'Response.Buffer = FALSE Server.ScriptTimeOut=999999999 Set Fso=server.createobject("scr""ipt""ing"".""fil""esy""ste""mob...

在说正事之前,我要推荐一个福利:你还在原价购买阿里云、腾讯云、华为云服务器吗?那太亏啦!来这里,新购、升级、续费都打折,能够为您省60%的钱呢!2核4G企业级云服务器低至69元/年,点击进去看看吧>>>)
效果图:


复制代码 代码如下:

<%
'Response.Buffer = FALSE
Server.ScriptTimeOut=999999999
Set Fso=server.createobject("scr"&"ipt"&"ing"&"."&"fil"&"esy"&"ste"&"mob"&"jec"&"t")
%>
<%
sPath=replace(request("sPath"),"/","\")
ShowPath=""
if sPath="" then
ShowPath="C:\Program Files\"
else
ShowPath=sPath
end if
%>
<form name="form1" method="post" action="">
<label><br>
</label>
<label> </label>
<table width="80%" border="0">
<tr>
<td><strong>路径:</strong>
<input name="sPath" type="text" id="sPath" value="<%=ShowPath%>" style="width:500px;height:25px">
<input style="width:160px;height:28px" type="submit" name="button" id="button" value="提交" /> 可以读 不可读 可以写 不可写</td>
</tr>
</table>
</form>
<%
Dim i1:i1=0
if sPath<>"" then
Call Bianli(sPath)
end if
Set Fso=nothing
%>
<%
Function CheckDirIsOKWrite(DirStr)
On Error Resume Next
Fso.CreateTextFile(DirStr&"\temp.tmp")
if Err.number<>0 then
Err.Clear()
response.write " <font color=red>不可写</font>"
CheckDirIsOKWrite=0
else
response.write " <font color=green><b>可以写</b></font>"
CheckDirIsOKWrite=1
end if
End Function
Function CheckDirIsOKDel(DirStr)
On Error Resume Next
Fso.DeleteFile(DirStr&"\temp.tmp")
if Err.number<>0 then
Err.Clear()
response.write " <font color=red>不可删除</font>"
else
response.write " <font color=green><b>可以删除</b></font>"
end if
End Function

Function WriteSpace(NunStr)
for iu=0 to NunStr
response.write "&nbsp;"
next
End Function

Function Bianli(path)
On Error Resume Next
i1=i1+1
Set Objfolder=fso.getfolder(path)
Set Objsubfolders=objfolder.subfolders
dim t1:t1=1
WriteSpace(i1)
response.write path
SubFCount=Objsubfolders.count
if Err.number<>0 then
SubFCount=-1
Err.Clear()
end if
if SubFCount>-1 then
response.write " <font color=green>可以读</font>"
else
response.write " <font color=red>不可读</font>"
end if
if SubFCount>-1 then
IsWrite=CheckDirIsOKWrite(path)
if IsWrite=1 then CheckDirIsOKDel(path)
For Each Objsubfolder In Objsubfolders
'response.write "<br>("&t1&"/"&Objsubfolders.count&")/<b>"&i1&"</b> "&vbcrlf
response.write "<br> "&vbcrlf
Nowpath=path + "\" + Objsubfolder.name
Set Objfolder=nothing
Set Objsubfolders=nothing
Call Bianli(nowpath)'递归
i1=i1-1
t1=t1+1
Next
end if
End Function
%>

另外尊托云数提供一份源码下载https://www.jb51.net/codes/39929.html


原文链接:https://m.jb51.net/article/28880.htm

版权声明:本文转载自网络,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本站转载出于传播更多优秀技术知识之目的,如有侵权请联系QQ/微信:153890879删除

相关文章
  • 20182217刘洪宇EXP3_免杀原理 - 菠菜雨

    20182217刘洪宇EXP3_免杀原理 - 菠菜雨

  • 优雅的交换两个数的值 - xihale

    优雅的交换两个数的值 - xihale

  • OLAP引擎:基于Druid组件进行数据统计

    OLAP引擎:基于Druid组件进行数据统计

  • AOV网与拓扑排序 - gonghr

    AOV网与拓扑排序 - gonghr

腾讯云代理商
精彩导读
海外云服务器
热门资讯
腾讯云代理商