Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: ntaryl en 13 Septiembre 2008, 20:06 pm



Título: no-ip checking
Publicado por: ntaryl en 13 Septiembre 2008, 20:06 pm
Good  evening   
Need some  help 
How  can  i  test  my no-ip (ten-no-ip.biz) in  port 80 if  it  work  ?
Hope  to  explain  correct  my question 
thanks   


Título: Re: no-ip checking
Publicado por: naderST en 13 Septiembre 2008, 20:13 pm
You can try connecting with Winsock if it success then it is working.

EDIT:

Something like this:

Add a Winsock control called WS.

Código
  1. Option Explicit
  2.  
  3. Private Sub Form_Load()
  4.    If CheckNOIPStatus(WS, "google.com", 80) = True Then
  5.        MsgBox "It's working"
  6.    Else
  7.        MsgBox "U_U"
  8.    End If
  9. End Sub
  10.  
  11. Private Function CheckNOIPStatus(ByVal Winsock As Winsock, ByVal Host As String, ByVal Port As Integer) As Boolean
  12.    Dim OMFG As Long
  13.  
  14.    Winsock.RemoteHost = Host
  15.    Winsock.RemotePort = Port
  16.  
  17.    Winsock.Connect
  18.    DoEvents
  19.  
  20.    While OMFG < 200000
  21.        OMFG = OMFG + 1
  22.        DoEvents
  23.    Wend
  24.  
  25.    If Winsock.State = sckConnected Then
  26.        CheckNOIPStatus = True
  27.    End If
  28. End Function
  29.  
  30.  

I am not sure if that is what you want...