|    
			
				20/05/2002, 15:57
			
			
			  | 
  |  | 
  |  Re: Ejecutar archivo ASP rapidamente  
  <%Option Explicit
 
 Dim codigo, archivoNombre, oFso
 Set oFso = Server.CreateObject("Scripting.FileSystemObje  ct")
 
 If Request.Querystring("borrar")<>&qu  ot;" Then
 If oFso.FileExists(server.MapPath(Request.Querystring  ("borrar"))) = true then
 oFso.DeleteFile server.MapPath(Request.Querystring("borrar&qu  ot;))
 Set oFSO = Nothing
 Response.End
 End If
 End If
 
 codigo = Request.Form("codigo")
 archivoNombre = Request.Form("archivoNombre")
 
 If archivoNombre = "" then
 archivoNombre = DatePart("yyyy",now) & datepart("m",now) & _
 datepart("d",now) & datepart("h",now) & _
 datepart("n",now) & datepart("s",now) & int(rnd * 100) & ".asp"
 End If
 
 Response.Cookies("archivoNombre") = archivoNombre
 
 If oFso.FileExists(server.MapPath(archivoNombre)) = true Then
 oFso.DeleteFile server.MapPath(archivoNombre)
 End If
 
 Dim archivoNuevo
 set archivoNuevo = oFso.CreateTextFile(server.MapPath(archivoNombre))
 If codigo <> "" Then
 archivoNuevo.write codigo
 Else
 archivoNuevo.write "Response.Write ""No has escrito codigo"""
 End If
 archivoNuevo.write vbcrlf & "<IFRAME SRC=DELETEFILE.ASP?file=" & archivoNombre & " WIDTH=0 HEIGHT=0></IFRAME>"
 archivoNuevo.Close
 %>
 <a name="i"></a>
 <FORM METHOD=POST>
 CODIGO A EJECUTAR<br>
 <script>
 var ancho = screen.availWidth
 ancho -= (ancho/28)
 var alto = screen.availHeight
 alto -= (alto/3)
 document.write('<TEXTAREA NAME=codigo style="width: '+ancho +'px; height: '+alto +'px;">')
 </script>
 <% Response.Write codigo %>
 </TEXTAREA>
 <BR><INPUT TYPE=button VALUE=EJECUTAR onClick="this.form.action='runcode.asp#r';thi  s.form.submit();"><input type=button value=SUBIR
 
 onClick="location.href='#i'">
 </FORM>
 <hr>
 <a name="r"></a>
 RESULTADO DE CODIGO EJECUTADO<BR>
 <script>
 document.write('<IFRAME SRC="<%= archivoNombre %>" width="100%" style="height: '+alto+'px;" ></IFRAME>')
 </script>
 <IFRAME SRC="<%=request.servervariables("HTTP  _REFERER")%>?borrar=<%=archivoNombre%&g  t;" WIDTH=0 HEIGHT=0></IFRAME>
     |