Advertisement
jsbsan

leerpag

Oct 10th, 2014
3,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.64 KB | None | 0 0
  1.  
  2. Public Function usandoHttpClient(DireccionUrl As String) As String
  3.  
  4.   Dim mihttp As New HttpClient
  5.   Dim contenido As String
  6.   Dim a As Integer = 0 'variable que nos sirve para no se exceda cierto tiempo en la descarga
  7.  
  8.   MiHttp.url = DireccionUrl
  9.   MiHttp.Get()
  10.  
  11.   While (Lof(MiHttp) = False And a < 10)
  12.     'espero 1 segundo o que llegue a>10
  13.     a = a + 1
  14.     Wait 1
  15.   Wend
  16.   If a = 10 Or Lof(MiHttp) = False Then
  17.     message("No ha sido posible conectarse al servidor \n No puedo comprobar si hay nueva versión")
  18.     Return
  19.   Endif
  20.   If Lof(MiHttp) Then
  21.     Read #MiHttp, contenido, Lof(MiHttp)
  22.   End If
  23.   Return contenido
  24.  
  25. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement