<%
Dim FilePath,ShowPath,FileIntro
FilePath=Request.ServerVariables("SCript_NAME")
FilePath=Replace(Lcase(FilePath),"filelist.asp","")
Action=Trim(Request.Form("Action"))
Select Case Action
	Case "FileList"
		Call FileList()
		Call Main()
	Case Else
		Call Main()
End Select
Sub Main()
%>
<form name="msform" method="post" action="">
<input type="text" name="FilePath" size="25" value="<%=FilePath%>">
<input type="hidden" name="action" value="FileList">
<input type="radio" name="showpath" value="0" <%If showpath=0 then Response.Write " Checked"%>>否<input type="radio" name="showpath" value="1" <%If showpath=1 then Response.Write " Checked"%>>是
<input type="text" name="FileIntro" size="25" value="<%=FileIntro%>">
<input type="submit" name="submit" value="提交">
</form>
<%
End Sub
Sub FileList()
    Dim Fso,LastDir
	FilePath = Trim(Request.Form("FilePath"))
    showpath = Trim(Request.Form("showpath"))
	FileIntro = Trim(Request.Form("FileIntro"))
	If showpath=1 and ubound(split(FilePath,"/"))>1 then
		LastDir=split(FilePath,"/")(ubound(split(FilePath,"/")))&"/"
	End If
	If instr(FilePath,"/")=0 or FilePath="" then
		Response.Write "格式不对,或者为空"
	Else
		Set Fso=server.createobject("Scripting.FileSystemObject")
		dim theFolder,theFile,strFileType
		if Not fso.FolderExists(Server.MapPath(FilePath)) then
			response.write "找不到数据库备份文件夹（"&FilePath&"）！"
			response.end
		end if
		Set theFolder=fso.GetFolder(Server.MapPath(FilePath))
		For Each theFile In theFolder.Files
		If FileIntro="" then FileIntro=theFile.name
		strFileType=lcase(mid(theFile.name,instrrev(theFile.name,".")+1))
		%>
		<%=theFile.name%>|<%=LastDir&Replace(theFile.name,".Html",".Asp")%>|1|<%=FileIntro%>|<%=round(theFile.size/1024)%><br>
		<%
		Next
	End If
End Sub
%>	