|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用windows系统,没有linux安全上面先容FSO按文件巨细扫瞄文件目次并举行删除操纵的办法:<%@Language=VBScript%>
<%Server.ScriptTimeout=50000%>
<HTML>
<HEAD>
<METANAME="GENERATOR"Content="MicrosoftVisualStudio6.0">
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
</HEAD>
<BODY>
<%
functionJudgeParaRegular(intID)
ifintID""andisnumeric(intID)then
JudgeParaRegular=intId
else
Response.Write"输出毛病!"
Response.End
endif
endfunction
intFileSize=JudgeParaRegular(Request.QueryString("intFileSize"))
strPath=Request.QueryString("strPath")
ifinstr(strPath,":")=0thenstrPath=server.MapPath(strPath)
%>
<%
functiondeletefiles(path)
onerrorresumenext
Setfs=Server.CreateObject("Scripting.FileSystemObject")
iffs.FileExists(path)then
fs.DeleteFilepath,True
response.write"乐成删除"&path
else
response.write"文件不存在!"
endif
Setfs=nothing
ifErr.number0thenResponse.WriteErr.number
endfunction
strFile=request("strFile")
ifrequest("strFile")""then
deletefilesstrFile
endif
%>
<%
functionListFolderFiles(strPath,intFileSize,intFlag)
strOriginPath=Request.ServerVariables("Script_Name")&"?strPath="&Request.QueryString("strPath")&"&intFileSize="&Request.QueryString("intFileSize")
ifstrPath""then
ifintFlag=0then
intFlag=intFlag+1
endif
SetobjFs=Server.CreateObject("Scripting.FileSystemObject")
SetobjFdir=objFs.GetFolder(strPath)
strParentPath=objFs.GetParentFolderName(strPath)
foreachstrSubFilesinobjFdir.files
ifstrSubFiles.size/(1024^2)>=intFileSizethen
Response.Write"<TR>"&vbcrlf
Response.Write"<TD>"&replace(strNullTran(strSubFiles),strNullTran(strSubFiles.Name),"<b>"&strNullTran(strSubFiles.Name)&"</b>")&"</TD>"&vbcrlf
Response.Write"<TD>"&strNullTran(FormatNumber(strSubFiles.size/(1024^2),2))&"MB</TD>"&vbcrlf
Response.Write"<TD>"&strNullTran(strSubFiles.type)&"</TD>"&vbcrlf
Response.Write"<TD>"&strNullTran(strSubFiles.datelastmodified)&"</TD>"&vbcrlf
Response.Write"<TD><AHREF="&strOriginPath&"&strFile="&strNullTran(strSubFiles)&"></A></TD>"&vbcrlf
Response.Write"</TR>"&vbcrlf
intFlag=intFlag+strSubFiles.size
endif
next
foreachstrSubFoldersinobjFdir.SubFolders
ifintFlag=0thenintFlag=1
ListFolderFilesstrSubFolders,intFileSize,intFlag
next
else
Response.Write"<tr><tdcolspan=5>输出毛病!</td></tr>"
endif
ListFolderFiles=intFlag
endfunction
functionstrNullTran(str)
ifisnull(str)orstr=""then
strNullTran=""
else
strNullTran=str
endif
endfunction
Response.Write"<TABLEWIDTH=100%BORDER=1CELLSPACING=1CELLPADDING=1>"&vbcrlf
Response.Write"<TR>"&vbcrlf
Response.Write"<TD>文件名及路径</TD>"&vbcrlf
Response.Write"<TDalign=center>巨细</TD>"&vbcrlf
Response.Write"<TDalign=center>种别</TD>"&vbcrlf
Response.Write"<TDalign=center>修正工夫</TD>"&vbcrlf
Response.Write"<TDalign=center>删除</TD>"&vbcrlf
Response.Write"</TR>"&vbcrlf
intFlag=ListFolderFiles(strPath,CDbl(intFileSize),0)
Response.Write"<tr><tdalign=right>总计:</td><tdcolspan=4>"&formatNumber((intFlag-1)/(1024^2),2)&"MB</td></tr>"&vbcrlf
Response.Write"</TABLE>"&vbcrlf
%>
</BODY>
</HTML>
使用cdonts,可以发送、查看邮件,实现webmail的功能。结合wsh,可以实现对nt主机的管理,如nt用户管理、iis虚拟主机设置、exchange邮箱设置等等,就像管理本地机一样方便。 |
|