|
-
Jan 2nd, 2007, 01:08 PM
#1
Thread Starter
Addicted Member
Getting Information from a website and login
Hi all,
I'm making an application to check for new messages on a forum. I want user to be able to login. check to see if it was successful. If yes then go to Form2 else error message.
I have tried a few methods but none seem to work that well. Any ideas on how i could do this or if no one can think of anything i'll post the code i currently have and maybe people could help me adapt it??
If anyone could help with this it will be very greatful.
Thanks in advance,
Ross
-
Jan 2nd, 2007, 01:27 PM
#2
Member
Re: Getting Information from a website and login
Are you using the INet control? If so, try downloading THIS ... It's something I wrote that logs into myspace.com, but you can see the way I did it... After the page source is retrieved, search for something the page would have if it logged in successfully, and "IF" it finds it, you're golden...
-
Jan 2nd, 2007, 03:00 PM
#3
Thread Starter
Addicted Member
Re: Getting Information from a website and login
Hi mate,
Yea i was actually looking at your script a while back. Becuase i have only been coding VB for around a month now I got a bit confused. I got as far as connection to the website and sening POST information to login. I have not figured out how to see if a certain string of text os on the page or to check whether the login is successful.
Any Suggestions?
Thanks,
Ross
-
Jan 2nd, 2007, 03:25 PM
#4
Re: Getting Information from a website and login
 Originally Posted by tarponkeith
Are you using the INet control? If so, try downloading THIS ... It's something I wrote that logs into myspace.com, but you can see the way I did it... After the page source is retrieved, search for something the page would have if it logged in successfully, and "IF" it finds it, you're golden...
Your code would probably help a lot in this thread:
http://www.vbforums.com/showthread.php?t=445271
-
Jan 2nd, 2007, 03:34 PM
#5
Thread Starter
Addicted Member
Re: Getting Information from a website and login
Ok thanks. I think i can get as far a loggin in using POST data but now do i find a string in the source of the file i opened in inet?
-
Jan 2nd, 2007, 03:45 PM
#6
Member
Re: Getting Information from a website and login
The easy way would be viewing the source by hand, seeing a string that says "you are logged in" or something, and hard coding that into the program. Lets say you want to log into hotmail, maybe you could have your program check the code for a "Inbox (" and if it finds that string, you're logged in.
-
Jan 2nd, 2007, 03:47 PM
#7
Member
Re: Getting Information from a website and login
In the following, all variables and subroutines are made up, just an example of how you COULD do it...
VB Code:
dim myBigString as string ' holds all contents from iNet
myBigString = getPageSourceUsingInet("URL")
if instr(1,mybigstring,"you are logged in") = 0 then
' you are NOT logged in
msgbox "WRONG!"
else
'yay, logged in
msgbox "WooHoo"
end if
-
Jan 2nd, 2007, 04:02 PM
#8
Thread Starter
Addicted Member
Re: Getting Information from a website and login
Ok thanks for the help so far!!
Do you know what the subroutine is for getting the source from inet? I've been searching but cant seem to find much on inet
-
Jan 2nd, 2007, 04:11 PM
#9
Thread Starter
Addicted Member
Re: Getting Information from a website and login
BINGO! Thanks a looooad guys! 1 more thing, what is the easiest way of storing their username and password as a "Remember me" function?
Thanks,
Ross
-
Jan 2nd, 2007, 04:16 PM
#10
Re: Getting Information from a website and login
 Originally Posted by Ross_m
BINGO! Thanks a looooad guys! 1 more thing, what is the easiest way of storing their username and password as a "Remember me" function?
Thanks,
Ross
Easiest? GetSetting() And SaveSetting() functions which save to the registry.
You may want to do a simple encryption or something on the password for security reasons...
-
Jan 2nd, 2007, 04:17 PM
#11
Member
Re: Getting Information from a website and login
There's plenty of options, but no matter how you do it, make sure it's encrypted... INI file, registry setting, simple registry setting (using the savesetting/getsetting commands), hide it inside an .exe or other file...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|