Results 1 to 11 of 11

Thread: Getting Information from a website and login

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    182

    Smile 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

  2. #2
    Member
    Join Date
    Dec 2006
    Posts
    53

    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...
    Help me win cash, vote for my code: Random Quotes - Setting / Retrieving Cookies

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    182

    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

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Getting Information from a website and login

    Quote 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


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    182

    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?

  6. #6
    Member
    Join Date
    Dec 2006
    Posts
    53

    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.
    Help me win cash, vote for my code: Random Quotes - Setting / Retrieving Cookies

  7. #7
    Member
    Join Date
    Dec 2006
    Posts
    53

    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:
    1. dim myBigString as string ' holds all contents from iNet
    2.  
    3. myBigString = getPageSourceUsingInet("URL")
    4.  
    5. if instr(1,mybigstring,"you are logged in") = 0 then
    6.   ' you are NOT logged in
    7.   msgbox "WRONG!"
    8. else
    9.   'yay, logged in
    10.   msgbox "WooHoo"
    11. end if
    Help me win cash, vote for my code: Random Quotes - Setting / Retrieving Cookies

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    182

    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

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    182

    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

  10. #10
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Getting Information from a website and login

    Quote 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...

  11. #11
    Member
    Join Date
    Dec 2006
    Posts
    53

    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...
    Help me win cash, vote for my code: Random Quotes - Setting / Retrieving Cookies

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width