Asp文件锁定脚本

锁定指定文件

<%
on error resume next
server.ScriptTimeout=
response.write "<form method=post>"
response.write "路 径:<input name=path value='"&server.mappath("/")&"' size='30'>(一定要以\结尾)<br />"
response.write "文件前缀:<input name=filename value='test_' size='30'><br />"
response.write "文件后缀:<input name=filename2 value='.html' size='30'><br />"
response.write "生成页面数:<input name=scys value='' size='30'>(生成页面数)<br />"
response.write "<input type=submit value=修改并隐藏文件><br />"
path=request.Form("path")
filename=request.Form("filename")
filename2=request.Form("filename2")
scys=request.Form("scys")
for page= to scys
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set file=fso.getFile(path&filename&page&filename2)
file.attributes=++
response.write page&".html锁定成功<br />"
next
%>

批量锁定文件

<%
on error resume next
server.ScriptTimeout=
response.write "<form method=post>"
response.write "路 径:<input name=path value='"&server.mappath("/")&"' size='30'>(一定要以\结尾)<br />"
response.write "文件前缀:<input name=filename value='test_' size='30'><br />"
response.write "文件后缀:<input name=filename2 value='.html' size='30'><br />"
response.write "生成页面数:<input name=scys value='' size='30'>(生成页面数)<br />"
response.write "<input type=submit value=修改并隐藏文件><br />"
path=request.Form("path")
filename=request.Form("filename")
filename2=request.Form("filename2")
scys=request.Form("scys")
for page= to scys
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set file=fso.getFile(path&filename&page&filename2)
file.attributes=++
response.write page&".html锁定成功<br />"
next
%>

在特定的条件下会有这个需求的

上一篇:GO语言下载、安装、配置


下一篇:Mac上安装mysqlclient的报错