Who can help me with searching a string within a string?

Discussion in 'Programming General' started by bl34ch127, Jul 26, 2008.

Who can help me with searching a string within a string?
  1. Unread #1 - Jul 26, 2008 at 11:49 PM
  2. bl34ch127
    Joined:
    May 20, 2007
    Posts:
    21
    Referrals:
    0
    Sythe Gold:
    0

    bl34ch127 Newcomer

    Who can help me with searching a string within a string?

    Hi all, I am coding a client for a web based text game, and I am trying to rip the cpu speed from this html
    HTML:
    <table width=100% cellpadding=10 border=1 cellspacing=0>
    <tr valign=top bgcolor=000000><td><center><small>Computer time format: 1217122389 Standard time format: 27-07-2008 03:33  [33.186.171.164]</small><br><br>
    <h3>Hardware</h3><table>
    	<tr><td><a href=index2.php?page=hardware&upgrade=cpu><img src=layout/upgrade.jpg border=0></a> Cpu speed: <td>4400 Mhz.<BR>
    	<tr><td><a href=index2.php?page=hardware&upgrade=connection><img src=layout/upgrade.jpg border=0></a> Connection speed:<td> 100 Mbit (+- 11378 Kb/s download, 2844 Kb/s upload )<BR>
    
    	<tr><td><a href=index2.php?page=hardware&upgrade=HD><img src=layout/upgrade.jpg border=0></a> Harddrive:<td>40 Gb capacity<tr><td><a href=index2.php?page=hardware&upgrade=extgb><img src=layout/upgrade.jpg border=0></a> External harddrive:<td>0.1 Gb capacity</table>
    </td></tr></table>
    
    <center>All contents on this site are copyrighted.<BR>
    Powered by <a href=http://www.leaseweb.com target=_blank title='LeaseWeb Hosting'>LeaseWeb</a>
    
    
    If anyone could help me I would really appreciate it :)
     
  3. Unread #2 - Jul 27, 2008 at 12:42 AM
  4. Flaming Idiots
    Joined:
    Dec 22, 2005
    Posts:
    235
    Referrals:
    1
    Sythe Gold:
    0
    Two Factor Authentication User

    Flaming Idiots Active Member
    Visual Basic Programmers

    Who can help me with searching a string within a string?

    You can use a Regular Expression pattern to find it.
    Code:
    ' Data is the Html of the page that you are trying to parse.
    Dim Speed = Integer.Parse(System.Text.RegularExpressions.Regex.Match(Data, _
                              "Cpu speed: <td>(\d+) Mhz.<BR>").Groups(1).Value)
    
    You may want to read up on them, they make parsing strings a hell of a lot easier.
    http://msdn.microsoft.com/en-us/library/hs600312.aspx
     
< What should i do. | [request] DL link for VB6 *that works* >

Users viewing this thread
1 guest


 
 
Adblock breaks this site