Advertisement
jsbsan

extraerHttpClient

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