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 Ruzzykinz.
Today 06:14 PM
Last post by Bex
Today 06:44 PM
40 Replies, 67 Views
Go to first new post Selling 18 million pure...
11-28-2008 10:06 PM
by Sticky
Last post by Horde
Today 06:40 PM
6 Replies, 83 Views
Go to first new post Its my Birthday tomorrow.
12-02-2008 07:23 AM
by Zombies
Last post by Bex
Today 06:38 PM
59 Replies, 300 Views
Go to first new post Fucking AMAZING!!!
11-21-2008 02:16 PM
Last post by Hale'iwa
Today 06:38 PM
13 Replies, 118 Views
Go to first new post Buy it NOW! Special...
11-19-2008 10:30 PM
Last post by babygi9538
Today 06:34 PM
71 Replies, 888 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:45 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.09338188 seconds (100.00% PHP - 0% MySQL) with 19 queries