As requested;
does not use web browser (as requested)
is sort of a smart refresher
PHP Code:
Public Class frmMain
Dim StrHTML As String
Dim IntSpeed As Integer
Public Wrapper As HTTPWrapper = New HTTPWrapper
Private Sub chkHide_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkHide.CheckedChanged
If (chkHide.Checked = True) Then
txtPassword.PasswordChar = "•"
Else
txtPassword.PasswordChar = ""
End If
End Sub
Private Sub cmdStartStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStartStop.Click
If (cmdStartStop.Text = "Start") Then
tmrRefresh.Enabled = True
IntSpeed = txtSpeed.Text
cmdStartStop.Text = "Stop"
ElseIf (cmdStartStop.Text = "Stop") Then
tmrRefresh.Enabled = False
cmdStartStop.Text = "Start"
End If
End Sub
Private Sub tmrRefresh_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrRefresh.Tick
IntSpeed = IntSpeed - Val(1)
If (IntSpeed <= 0) Then
StrHTML = Wrapper.GetWrapper(txtURL.Text, "http://www.gaiaonline.com/")
IntSpeed = txtSpeed.Text
End If
End Sub
Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
Dim StrHTML As String
Dim StrFrob As String
Dim StrToken As String
If (txtUsername.Text = (vbNullString) Or txtPassword.Text = (vbNullString)) Then
MessageBox.Show("Please enter a username and or a password!", "Error")
Exit Sub
End If
StrHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/", "http://www.google.com/")
txtUsername.Enabled = False
txtPassword.Enabled = False
cmdLogin.Enabled = False
chkHide.Enabled = False
StrToken = GetStringBetween(StrHTML, "name=""token"" value=""", """")
StrFrob = GetStringBetween(StrHTML, "name=""frob"" value=""", """")
StrHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/auth/login", "token=" & StrToken & "&sid=&frob=" & StrFrob & "&toolbar_id=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&username=" & txtUsername.Text & "&password=" & txtPassword.Text & "&chap=", "http://gaiaonline.com/")
If (InStr(1, StrHTML, "?login_success=1") <> 0) Then
MessageBox.Show(txtUsername.Text & " : Has logged in!")
Else
MessageBox.Show(txtUsername.Text & " : Failed to login")
txtUsername.Enabled = True
txtPassword.Enabled = True
cmdLogin.Enabled = True
chkHide.Enabled = True
End If
End Sub
End Class
Results 1 to 1 of 1
Thread: [vb.net] Reresher for Uber_Noob
- 20 Jan. 2010 05:11am #1
[vb.net] Reresher for Uber_Noob