Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: Rudy21 en 5 Octubre 2008, 03:20 am



Título: verificar Si Web Está Online
Publicado por: Rudy21 en 5 Octubre 2008, 03:20 am
Pues Estoy haciendo un programa que verifique si una web está online cada 15min o determinado time

ya intente con text1.text = Inet1.openurl

si hay codigo en el textbox pues está online si no pues offline

pero no me funciona muy bien

alguna idea?

hago que meta un texto en un txt como log

tmb intente con fileexists pero nada

alguna idea

Gracias!


Título: Re: verificar Si Web Está Online
Publicado por: naderST en 5 Octubre 2008, 03:39 am
Código
  1. Option Explicit
  2.  
  3. Private Sub Form_Load()
  4.    Dim Response As String
  5.  
  6.    Response = Inet1.OpenURL("http://localhost")
  7.  
  8.    If Response = "" Then
  9.        MsgBox "Offline"
  10.    Else
  11.        MsgBox "Online"
  12.    End If
  13. End Sub
  14.  
  15.  


Título: Re: verificar Si Web Está Online
Publicado por: Rudy21 en 5 Octubre 2008, 03:42 am
sencillo y demasiado funcional jajaja

mil gracias

Salu2


Título: Re: verificar Si Web Está Online
Publicado por: seba123neo en 5 Octubre 2008, 07:04 am
Hola,en vez de usar un control ocx como el Inet podes usar la api InternetCheckConnection ,algo asi:

Código
  1. Option Explicit
  2.  
  3. Private Const FLAG_ICC_FORCE_CONNECTION = &H1
  4.  
  5. Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
  6.  
  7. Private Sub Form_Load()
  8. If InternetCheckConnection("http://www.google.com", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then
  9.    MsgBox "No esta disponible"
  10. Else
  11.    MsgBox "Si esta disponible"
  12. End If
  13. End Sub

saludos.