ThyElite Forums  
Go Back   ThyElite Forums > MyCoke Talk > Help!
Reload this Page Visual Basic Help?
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
(#5)
Old
Sifter is Offline
Master of the Post
Sifter is on a distinguished road
 
Posts: 309
Join Date: Jul 2006
Location: Stockton, California
Send a message via AIM to Sifter Send a message via MSN to Sifter Send a message via Yahoo to Sifter
Default 07-29-2006, 01:55 AM

Code:
Public Function GetStringBetween(ByVal InputText As String, _
                                 ByVal StartText As String, _
                                 ByVal EndText As String, _
                                 Optional ByVal StartPosition = 1) As String

    'Standard Function as supplied by Mumei - NOT case sensitive and uses mid, not mid$
    Dim lnTextStart As Long
    Dim lnTextEnd As Long

    lnTextStart = InStr(StartPosition, InputText, StartText, vbTextCompare) + Len(StartText)
    lnTextEnd = InStr(lnTextStart, InputText, EndText, vbTextCompare)
    If lnTextStart >= (StartPosition + Len(StartText)) And lnTextEnd > lnTextStart Then
        'we've found the entry
        GetStringBetween = Mid(InputText, lnTextStart, lnTextEnd - lnTextStart)
    Else
        GetStringBetween = ""
    End If
End Function

Private Sub Command1_Click()
WebBrowser1.Navigate ("http://mycoke.com/sumo.do?screenname=" + Text1.Text + "&prize=1")
If code = "0" = GetStringBetween(Buffer, "<result code=", "/>") Then
        Label3.Caption = "Success!"
Else
       Label3.Caption = "Failed."
End If

WebBrowser2.Navigate ("http://mycoke.com/sumo.do?screenname=" + Text1.Text + "&prize=2")
If code = "0" = GetStringBetween(Buffer, "<result", "/>") Then
        Label4.Caption = "Success!"
Else
       Label4.Caption = "Failed."
End If

WebBrowser3.Navigate ("http://www.mycoke.com/sumo.do?screenname=" + Text1.Text + "&prize=3")
If code = "0" = GetStringBetween(Buffer, "<result code=", "/>") Then
        Label5.Caption = "Success!"
Else
       Label5.Caption = "Failed."
End If
End Sub
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Visual Basic 6 TAG General Talk 0 10-10-2006 10:24 PM
Need Visual Basic 6 TAG General Talk 0 10-10-2006 09:29 PM
Visual Basic 6 Masked Requests 3 08-22-2006 07:44 PM
A basic MyCoke login in Visual Basic 6 DefectiveProduct Cheat Talk 6 07-18-2006 06:40 AM
Visual Basic 6 Matt_Hardy Shithole 3 06-22-2006 12:01 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.