Hi Guys,
I can't seem to see a solution to this problem, i have this function:
vb.net Code:
Function functionDisplayLoggedInAccountData(ByVal HTML As String) Dim testStr As String = HTML Dim startAt As Integer = 0 Dim lastIndex As Integer = 0 Do lastIndex = startAt '// The first apttern we are looking for Dim rx As New Regex("<tr bgcolor=""lightgreen"">") startAt = rx.Match(testStr, startAt).Index + 28 If startAt < lastIndex Then Exit Do '// The second pattern we are looking for rx = New Regex("(?<=<td nowrap>).*(?=</td>)") '// The third pattern we are looking for Dim rxNew = New Regex("(?<=<td>).*(?=</td>)") Dim postIDNumber As Integer = rxNew.Matches(testStr, startAt).Item(0).Value With formMain.mainListView.Items.Add(rx.Matches(testStr, startAt).Item(0).Value) .SubItems.Add(rx.Matches(testStr, startAt).Item(1).Value) .SubItems.Add(rx.Matches(testStr, startAt).Item(2).Value) '// Do some string manipulation Dim newString As String = rx.Matches(testStr, startAt).Item(3).Value.Replace("<a href=""/post/shwpst?pii=" & (postIDNumber) & "&db=lv"">", "") Dim finalString As String = newString.Replace("</a>", "") .SubItems.Add(finalString) '// Colour the background .BackColor = Color.PaleGreen End With Loop Return True End Function
Which works well, but there are 2 more html fields called:
td bgcolor="lightblue"
td bgcolor="lightgrey"
In my code i just look for the bgcolor="lightgreen" field, is there a way i can get all colours and display the listview background colour accordingly?
thanks guys
Graham




Reply With Quote