Hi everyone..
I am trying to get the "Numbers" only showen in the Image Above, from a Webpage and into a Listbox. But I simply cant make it work. :confused: .I tried to use a Regex method, but since there are only one coma at the end of each Numbers, I ran out of ideas.
Hope I can get some help, about how to get the numbers directly into a Listbox?
My Regex Code:
Code:
Public Function GetBetween(ByVal input As String, ByVal str1 As String, ByVal str2 As String, ByVal index As Integer) As String
Dim temp As String = Regex.Split(input, str1)(index + 0)
Return Regex.Split(temp, str2)(0)
End FunctionMy Main code looks something like this Code below:
Code:
Private Function GetProc(ByVal Proc As String)
Try
Dim Webreq As HttpWebRequest = HttpWebRequest.Create("HERE GOES THE URL")
Using Webres As HttpWebResponse = Webreq.GetResponse
Using Reader As New StreamReader(Webres.GetResponseStream)
Using Rich As New RichTextBox With {.Text = Reader.ReadToEnd}
For i As Integer = 0 To Rich.Lines.Count - 1
Dim line As String = Rich.Lines(i)
If line.Contains(Chr(34) & "proc" & Chr(34)) Then
Dim Num As Integer = 3
Do Until Rich.Lines(i + Num).Contains("]")
ListBox1.Items.Add(GetBetween(Rich.Lines(i + Num), "between1", "between2", 1))
Num += 1
Loop
Exit Function
End If
Next
End Using
End Using
End Using
Catch ex As Exception
ListBox1.Items.Add("None!")
End Try
End FunctionThank you very much in advance!