Ver Mensaje Individual
  #29 (permalink)  
Antiguo 30/07/2007, 12:09
sqa212
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 22 años
Puntos: 0
Re: funcion existe carpeta remota

Lexus creo que de esta forma podrias hacerlo solo con asp:

<%
Function UrlPing(strHost)
PATH = Server.mappath(".")
FILENAME = "Lexus.txt"
TARGET = PATH&"/"&FILENAME
textobusqueda="perdidos ="
Set objShell = Server.CreateObject("Wscript.Shell")
objShell.Run "%ComSpec% /c ping " & strHost & ">"&TARGET,0,true
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.OpenTextFile(target, 1)
do while not file.AtEndOfStream
estalinea=file.ReadLine
PING_OUTPUT = PING_OUTPUT & (estalinea & "<br>")
Pos=InStr(estalinea,textobusqueda)
If InStr(estalinea,textobusqueda)>0 Then
response.Write(estalinea) &"<br>"
UrlPing=Right(estalinea,2)
End if
loop
file.Close()
End Function

strHost = "www.forosdelweb.com"
Resultado=UrlPing(strHost)
If len(Resultado)>0 Then
Response.Write("Puedo buscar la carpeta<br>")
Response.Write(Resultado)
else
Response.Write("No puedo buscar la carpeta<br>")
Response.Write(Resultado)
End if
%>