Go Back   Gaming Gutter > Non-Gaming > Programming > Tutorials


Tutorials - Looking for programming tutorials to increase your knowledge? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Lenny Conundrum
02-09-2007 11:09 AM
by Noodle
Last post by G.I.R.
Today 06:23 PM
740 Replies, 34,704 Views
Go to first new post Ruzzykinz.
Today 06:14 PM
Last post by Vaginal-Milkshake
Today 06:22 PM
12 Replies, 13 Views
Go to first new post Whats your favorite...
08-06-2008 08:59 PM
Last post by Mirage
Today 06:18 PM
109 Replies, 833 Views
Go to first new post I feel like shit.
Yesterday 10:49 PM
Last post by Zombii
Today 06:18 PM
28 Replies, 123 Views
Go to first new post Anglo-Saxon Riddles
Today 05:53 PM
by Fewmitz
Last post by Fewmitz
Today 06:16 PM
2 Replies, 3 Views
Reply
 
LinkBack Thread Tools Display Modes

 [vb6] Having your program auto log back in
Old 08-11-2008, 02:16 PM   #1 (permalink)
Site Programmer

Male Violent_J is offline
 
Violent_J's Avatar
 
Join Date: Nov 2006
Location: Sacramento, California
Age: 17
Posts: 937
GPoints: 731
iTrader: 5 / 100%
Violent_J Is Amongst RoyaltyViolent_J Is Amongst Royalty
Rep Power: 9
[vb6] Having your program auto log back in

In my new program I have this feature.

It is basically just this

Code:
Sub Login_to_neopets()
    StopProgram = False
    cmdlogin.Enabled = False


    strHTML = w.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtusername.Text & "&password=" & txtpassword.Text & "&destination=%2Findex.phtml", "http://www.neopets.com/hi.phtml")
    If InStrB(1, strHTML, "badpassword") Then
        lblstatus.Caption = "Wrong password!"
        cmdlogin.Enabled = True
    ElseIf InStrB(1, strHTML, "FROZEN") Then
        lblstatus.Caption = "Account frozen!"
        cmdlogin.Enabled = True
    ElseIf InStrB(1, strHTML, "too many times") Then
        lblstatus.Caption = "Guessed password too many times!"
        cmdlogin.Enabled = True

    ElseIf InStrB(1, strHTML, txtusername.Text) Then
        txtlog.Text = txtlog.Text & vbNewLine & Time & " : Relogged in as " & txtusername.Text
        cmdstart.Enabled = True
        cmdstart_Click
        lblstatus.Caption = "Logged in as " & txtusername.Text
        cmdlogin.Enabled = False
        Call SaveSetting("Violent_J's neopets login", "Login", "Username", txtusername.Text)
        Call SaveSetting("Violent_J's neopets login", "Login", "Password", txtpassword.Text)

    End If
End Sub

If InStrB(1, strHTML, "<a href=" & ChrW$(34) & "/loginpage.phtml" & ChrW$(34) & "><b>Login to Neopets!</b></a>") And chklogin.Value = Checked Then
            txtlog.Text = txtlog & vbNewLine & Time & " : Logged out of " & txtusername.Text & ", logging back in!"
            cmdstop_Click
            cmdstop.Enabled = False
            cmdstart.Enabled = False
            lblstatus.Caption = "Idle.."
            cmdlogin.Enabled = True
            Login_to_neopets
In this program, I used a text box as a log so you may have to edit this for a listbox.
I made the "automatically log in when logged out" a feature called "chklogin"

You may edit this if you like to fit your code etc.
This is just the basic gist of it as I am sure there is a more "proper and efficient" way of doing it.
__________________



Current rep: 111
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 06:23 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.09750104 seconds (100.00% PHP - 0% MySQL) with 19 queries