Advertisement
jsbsan

limipaweb

Oct 10th, 2014
1,449
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Public Sub limpiarCodigo(contenidoweb As String)
  3.  
  4.   Dim a As Integer
  5.   Dim lineas As String[]
  6.  
  7.   Dim id As String
  8.   Dim nombre As String
  9.   Dim puntos As String
  10.   Dim pais As String
  11.  
  12.   contenidoweb = Replace$(contenidoweb, "<br>", "")
  13.   contenidoweb = Replace$(contenidoweb, "<tr>", "")
  14.   contenidoweb = Replace$(contenidoweb, "</tr>", "")
  15.   contenidoweb = Replace$(contenidoweb, "<td>", "")
  16.   contenidoweb = Replace$(contenidoweb, "</td>", "")
  17.   contenidoweb = Replace$(contenidoweb, "<th>", "")
  18.   contenidoweb = Replace$(contenidoweb, "</th>", "")
  19.   contenidoweb = Replace$(contenidoweb, "<table>", "")
  20.   contenidoweb = Replace$(contenidoweb, "</table>", "")
  21.   lineas = Split(contenidoweb, "\n\t", "", True)
  22.  
  23.   For a = 0 To lineas.Max
  24.     lineas[a] = Trim(lineas[a])
  25.  
  26.   Next
  27.   lineas.Join("\n")
  28.   lineas = Split(contenidoweb, "\n\t", "", True)
  29.  
  30.   If lineas[0] = "Connected successfully" Then
  31.     GridView1.rows.count = 0 'limpiamos el gridviews
  32.     For a = 1 To lineas.max Step 4
  33.       id = lineas[a]
  34.       nombre = lineas[a + 1]
  35.       pais = lineas[a + 2]
  36.       puntos = lineas[a + 3]
  37.       rellenagridview(id, nombre, pais, puntos)
  38.  
  39.     Next
  40.  
  41.   Else
  42.     Message.Error("No ha sido posible leer el marcador online")
  43.   Endif
  44.  
  45. End
Advertisement
RAW Paste Data Copied
Advertisement