troubleshooting Question

HTTPWeb Request/Response

Avatar of tjgrindsted
tjgrindsted asked on
ASP.NETVB Script
7 Comments1 Solution270 ViewsLast Modified:
Hi i have this code, that shows a soccer match ranklist.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim request As HttpWebRequest = CType(WebRequest.Create("http://www.dbu.dk/turneringer_og_resultater/resultatsoegning/position.aspx?poolid=135814"), HttpWebRequest)
        Dim response As HttpWebResponse = CType(Request.GetResponse(), HttpWebResponse)
        Dim reader As StreamReader =  New StreamReader(response.GetResponseStream(),Encoding.GetEncoding("iso-8859-1"))
  

        Dim input As String = reader.ReadToEnd()
        Dim StartToken As String = "<div id="div2"></div>"
        Dim EndToken As String = "<div class="PageUnionInfo" id="PageUnionInfo" style="margin-bottom:4px;">"
        Dim ContentStartPosition As Integer = input.IndexOf(StartToken) + StartToken.Length
        Dim ContentEndPosition As Integer = input.IndexOf(EndToken)
        Dim Length As Integer = ContentEndPosition - ContentStartPosition
        Dim Content As String = intput.Substring(ContentStartPosition, Length)
        someLabel.Text = Content
    End Sub

this code will the ranking list.
My question is, if i need to find a targ/name maybe like "c01 first" and i need to go 8 steps after the name and then show the text from that place to the next "<" how do i do that in asp.net.

In asphttp i know that i can do it like this:

Read=instr(ReadEnd,strResult,"c01 first")+8
ReadEnd=instr(Read,strResult,"<")
Team1=mid(strResult,Read,ReadEnd-Read)

but how do i do it in ASP.NET !?
ASKER CERTIFIED SOLUTION
tjgrindsted

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros