Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

[Resolvido] Explorer

Recommended Posts

Exemplo de explorer. Você pode usá-lo para editar arquivos, fazer upload de arquivos, criar arquivos, e muito mais

 

default.asp

<%

Dim Name(9999), Size(9999), LastMod(9999), Querys(20)
o = 1
If Request.QueryString = "" then 
Response.Write "<meta http-equiv=refresh content=1;URL=default.asp?path=.>"
End If

For each Query in Request.QueryString
		For each Queryvalue in Request.QueryString(Query)
		Querys(o) = Queryvalue
		Next
		o = o + 1
Next

Set objFS = Server.CreateObject("Scripting.FileSystemObject")

On error resume next
Set objFolders = objFS.GetFolder(Server.MapPath(Querys(1)))
Set objFiles = objFolders.Files
i = 1
For each File in objFiles
	Name(i) = File.Name
	Size(i) = File.Size
	LastMod(i) = File.DateLastModified
	i = i + 1
Next
i = i - 1
For t = 1 to i
	Size(t) = Size(t) * 0.001
	Size(t) = Left(Size(t), 4)
Next
Set objGet = objFS.GetFile(Server.MapPath(Name(i)))
Folder = objFolders.Name
%>
<html>
<head>
<title>Guo's Explorer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body bgcolor="#006699" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="760" border="0" cellpadding="0" cellspacing="0" height="45">
  <tr>
    <td><img name="interface" src="gfx/interface.gif" width="760" height="45" border="0" usemap="#m_interface"> 
      <!-- fwtable fwsrc="explorer.png" fwbase="interface" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
      <map name="m_interface"> 
        <area shape="rect" coords="666,17,706,30" href="#" alt="Upload a file" title="Upload a file" >
        <area shape="rect" coords="610,17,657,29" href=" <% Response.Write "default.asp?path=" & Querys(1) & "&action=createfolder" %>" alt="Creates a new folder or a new file" title="Creates a new folder or a new file" >
        <area shape="rect" coords="558,16,597,30" href="default.asp?path=." alt="Get some facts about your server and your computer." title="Get some facts about your server and your computer." >
</map></td>
  </tr>
</table>
<br>
<%
%>
<table width="760" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#FFFFFF"> 
    <td height="13" colspan="5"><font face="Times New Roman, Times, serif" size="2" color="#000000">Arquivo:                                                                                       Tamanho:                               
         Última modificação:                     Comandos:</font></td>
  </tr>
  <tr> 
    <td height="4" width="281"> 
      <%
	Old = Querys(1)
	News = strReverse(old)
	News = instr(News, "/")
	Leng = Len(old) - News
	Old = Left(Old, Leng)
	If Old = "" then Old = "."
	Response.Write "<a href=default.asp?path=" & Old & ">../</a><br>"
	q = 1
	For each SubF in objFolders.Subfolders
	If right(Path,1)="/" then
	WholeSubF=SubF.Name
	Else
	WholeSubF=SubF.Name
	End if
	q = q + 1
	Response.Write "<img src=gfx/folder.gif width=15 height=15><a href='default.asp?path=" & Querys(1) & "/" & WholeSubF & "'>" & WholeSubF & "</a><br>"
	Next
	q = q - 1
	%>
      <br>
      <%
	For t = 1 to i
	Response.Write "<img src=gfx/file.gif width=15 height=15><a href=" & Querys(1) & "/" & Name(t) & " target=_blank>" & Name(t) & "</a><br>"
	Next
	%>
    </td>
    <td height="4" width="126"> 
      <%
	For each SubF in objFolders.Subfolders
		Response.Write Left(SubF.Size * 0.001, 5) & "kb<br>"	
	Next
	%>
      <br>
      <%
	For t = 1 to i
	Response.Write Size(t) & "kb<br>"
	Next
	%>
    </td>
    <td height="4" width="135"> 
      <%
	For each SubF in objFolders.Subfolders
		Response.Write SubF.DateLastModified & "<br>"	
	Next
	%>
      <br>
      <%
	For t = 1 to i
	Response.Write LastMod(t) & "<br>"
	Next
	%>
    </td>
    <td height="4" width="104"> 
      <%
	For each SubF in objFolders.Subfolders
	Response.Write "<a href=default.asp?" & Request.QueryString & "&action=deletef&what=" & SubF.Name & ">Delete</a><br>"
	Next
	%>
      <br>
      <%
	For t = 1 to i
	Response.Write "<a href=default.asp?" & Request.QueryString & "&action=delete&what=" & name(t) & ">Delete</a><br>"
	Next
	%>
    </td>
    <td height="4" width="104"> 
      <%
	For each SubF in objFolders.Subfolders
		Response.Write "<br>"
	Next
	%><br>
      <%
	For t = 1 to i
	Response.Write("<a href=default.asp?path=" & Querys(1) & "&action=edit&what=" & name(t) & ">Edit</a><br>")
	Next
	%></td>
  </tr>
</table>
<br>
<br>
<table width="760" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#FFFFFF" height="19"><font face="Times New Roman, Times, serif" size="2" color="#000000"> Tamanho
      Pasta:  
      <%
	Response.Write objFolders.size * 0.001 & "kb"
%>
       Pasta Atual: 
      <% Response.Write Folder %>
        </font> </td>
  </tr>
</table>
<map name="Map"> 
  <area shape="rect" coords="666,17,706,30" href="#">
  <area shape="rect" coords="610,17,657,29" href="#">
  <area shape="rect" coords="558,16,597,30" href="default.asp?path=." onClick="MM_openBrWindow('misc.asp?action=info','','width=450,height=150')">
</map><%

If Querys(3) = "delete" then
	Set objKill = objFS.GetFile(Server.MapPath(Querys(2)))
	objKill.Delete
	response.write "<meta http-equiv=refresh content=1;URL=default.asp?path=" & Querys(1) & ">"
End If

If Querys(3) = "deletef" then
	Set objKill = objFS.GetFolder(Server.MapPath(Querys(2)))
	objKill.Delete
	response.write "<meta http-equiv=refresh content=1;URL=default.asp?path=" & Querys(1) & ">"
End If
%>
<br>
<%
If Querys(2) = "createfolder" then
%>
<table width="760" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  <tr>
    <td align="left" valign="top">
      <%
	  Response.Write("<form name=form1 method=post action=default.asp?path=" & Querys(1) & "&action=created>")
      %>
	    <font color="#000000" face="Times New Roman, Times, serif" size="2">Criar
        nova pasta: </font> 
        <input type="text" name="folder" maxlength="24">
        <input type="submit" name="Submit" value="Criar">
      </form>
    </td>
  </tr>
</table>
<br>
<%
response.write("<form name=forms method=post action=default.asp?path=" & querys(1) & "&action=createfile>")
%>
<table width="760" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  <tr> 
    <td align="left" valign="top"> <font color="#000000" face="Times New Roman, Times, serif" size="2">Criar
        novo arquivo: </font> 
      <input type="text" name="what" maxlength="24" value=".asp">
      <input type="submit" name="Submit3" value="Criar">
    </td>
  </tr>
</table>
</form>
<p>
  <%
End If
If Querys(2) = "created" then
	objFS.CreateFolder(Server.MapPath(Request.Form("folder")))
	Response.Write("<meta http-equiv=refresh content=1;URL=default.asp?path=" & Querys(1) & ">")
End If
If Querys(3) = "edit" then
%>
<table width="760" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  <tr>
    <td height="130"> <font color="#000000" face="Times New Roman, Times, serif" size="2">Editando<% Response.Write(Querys(2)) %>
      </font> 
<%
Response.Write("<form name=form1 method=post action=default.asp?path=" & Querys(1) & "&action=save&what?" & Querys(2) & ">")
Response.Write ("<textarea name=textfield cols=90 rows=10>")
	Set objTS = objFS.OpenTextFile(Server.MapPath(Querys(2)))
	Response.Write Server.HTMLEncode(objts.ReadAll)
Response.Write "</textarea>"
%>
                                                                                        
        <input type="submit" name="Submit2" value="Salvar">
      <form name="form1" method="post" action="">
        <input type="hidden" name="hidden" value="<% Response.Write Querys(2) %>">
      </form>
      </form>
    </td>
  </tr>
</table>
<p><br>
  <%
End If
If Querys(3) = "save" then
Set objTS = objFS.CreateTextFile(Server.MapPath(Request.Form("hidden")))
objTS.Write Request.Form("textfield")
Response.Write "<meta http-equiv=refresh content=1;URL=default.asp?path=" & Querys(1) & ">"
Response.Write("YEPP")
End If

If Querys(2) = "createfile" then
	objFS.CreateTextFile(Server.MapPath(Request.Form("what")))
	Response.Write("<meta http-equiv=refresh content=1;URL=default.asp?path=" & Querys(1) & ">")
End If
%>
</p>
</body>
</html>

misc.asp

<%
Dim Querys(20)
o = 1
If Request.QueryString = "" then 
Response.Write "<meta http-equiv=refresh content=1;URL=default.asp?path=.>"
End If

For each Query in Request.QueryString
		For each Queryvalue in Request.QueryString(Query)
		Querys(o) = Queryvalue
		Next
		o = o + 1
Next
%>
<html>
<head>
<title>Explorer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#006699" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
If Querys(1) = "info" then
%>
<table width="460" border="1" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="234" height="21" valign="top" bgcolor="#FFFFFF"><font color="#000000">Serverstats:</font></td>
    <td width="220" valign="top" bgcolor="#FFFFFF"><font color="#000000">Clientstats:</font></td>
    </tr>
</table>
<table width="459" border="1" cellspacing="0" cellpadding="0" height="144">
  <tr> 
    <td height="20" align="left" valign="top" width="233"> 
      <%
	Response.Write("Servername:" & Request.Servervariables("SERVER_NAME") & "<br>")
	Response.Write("Gatewayinterface:" & Request.Servervariables("GATEWAY_INTERFACE") & "<br>")
	Response.Write("Serverprotocol:" & Request.Servervariables("SERVER_PROTOCOL") & "<br>")
	Response.Write("Port:" & Request.Servervariables("SERVER_PORT") & "<br>")
	Response.Write("Software:" & Request.Servervariables("SERVER_SOFTWARE") & "<br>")
	%>
    </td>
    <td height="20" align="left" valign="top" width="220"> 
      <%
	Response.Write("IP:" & Request.Servervariables("REMOTE_ADDR") & "<br>")
	Response.Write("Host:" & Request.Servervariables("REMOTE_HOST") & "<br>")
	Response.Write("Browser:" & Request.Servervariables("HTTP_USER_AGENT") & "<br>")
	%></td>
  </tr>
</table>
<%
End If
%>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.