![]() |
Click here to advertise with us
|
|
|||||||
| VS.NET General Discussion Anything related to Visual Studio and not covered in a topic forum. Please use a specific forum from the list below if able! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hey People
![]() Ok, so I've got kind of a unique situation im looking for some solutions on. I'm VERY NEW to vb.net. Currently I have developed some code for crawling wep pages for specific content. I have a unique regex for each website and it collects information - ie: title, pictures, viewtime etc. So far I've collected all of these into an array and displayed the results on my site using innerhtml which works just fine. The problem is I would like to bind this data (In the multidimensional array) to a LISTVIEW ASP control. Reason being I want to harness the power of the DATAPAGER so all the results are not on one page. Also currently everytime a result is found, i ReDim Preserve the array to make it one bigger, but i've been told this is very memory consuming and not a good idea. I've also looked into ArrayLists, but they don't come multidimensional. I also want to sort these results by different columns in the array and redisplay them on the page. So I guess my questions are: Is using an Array/Array List the best way to store these results at runtime? If So, how do I databind my ListView to a multidimensional array? Am i completely missing some obvious solution? lol thx Here's a code snippet from searching youtube for results The arrResults() is publicly declared Code:
Public Function SearchYouTube() As Integer
'<a class="video-thumb-120" href="/watch?v=QI7e5cPFe1g" ><img title="asdf" src="http://i2.ytimg.com/vi/QI7e5cPFe1g/default.jpg"
Dim strSearchIn As String = GetPageHTML("http://www.youtube.com/results?search_query=" & strSearch & "&search_type=&aq=f")
Dim R As New Regex("<a\sclass=""video-.*""\shref="".*"".*><img\stitle="".*"".*="".*\.jpg""")
Dim RCount As MatchCollection = R.Matches(strSearchIn)
For Each M As Match In R.Matches(strSearchIn)
CountMatchNumberOfM = CountMatchNumberOfM + 1
Dim wordColl As MatchCollection = Regex.Matches(M.Value.Split("""").GetValue(7), "gif")
Dim strPic As String = ""
If wordColl.Count > 0 Then
strPic = M.Value.Split("""").GetValue(9)
Else
strPic = M.Value.Split("""").GetValue(7)
End If
Dim strHref As String = "<a target='_blank' href = ""http://www.youtube.com" & M.Value.Split("""").GetValue(3) & """>"
Dim strDesc As String
strDesc = M.Value.Split("""").GetValue(5)
If strDesc.Length > 25 Then
End If
Dim strLink As String
strLink = strHref & strDesc & "</a>" & "<br />"
Dim strSite As String = "You Tube"
Dim resultdivs As String = CreateDisplayDivs(strPic, strLink, strSite, strHref)
If arrResults Is Nothing Then
ReDim arrResults(0)
Else
ReDim Preserve arrResults(0 To arrResults.Length)
End If
arrResults(arrResults.Length - 1) = resultdivs
Next
End Function
|
|
|||
|
Edit:
I know this array isn't multidimensional, but in order to sort the results I'm going to have to make it so. Currently the results are passed to CreateResultDivs which combines the results passed to it with <div> and other html tags that i throw in the pages innerhtml currently |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|