
23/06/2006, 16:28
|
 | | | Fecha de Ingreso: marzo-2006 Ubicación: Uruguay
Mensajes: 493
Antigüedad: 19 años Puntos: 1 | |
En VB.net sería así...
Código:
Public Function UrlList(ByVal url As String) As ArrayList
Dim resultHTML() As Byte
Dim linksArray As ArrayList = New ArrayList
Dim myWebClient As WebClient = New WebClient
resultHTML = myWebClient.DownloadData(url)
Dim utf8Enc As UTF8Encoding = New UTF8Encoding
Dim myResultString As String = utf8Enc.GetString(resultHTML)
myResultString = myResultString.ToLower
Dim regularexpre As Regex = New Regex("href\\s*=\\s*(?:(?:\\\""(?<url>[^\\\""]*)\\\"")|(?<url>[^\\s]* ))")
Dim collectionUrls As MatchCollection = regularexpre.Matches(myResultString)
For Each res As Match In collectionUrls
For Each t As Group In res.Groups
linksArray.Add(t.Value)
Next
Next
Return linksArray
End Function
|