1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[VB.NET] Neopets Programming Tutorial

Discussion in 'Code Snippets and Tutorials' started by tharoux, May 28, 2009.

  1. tharoux

    tharoux Level IV

    Joined:
    Dec 30, 2006
    Messages:
    2,733
    Likes Received:
    126
    Location:
    In front of my PC, Montreal
    So I guess everything is working now XD
     
  2. Violent_J

    Violent_J Level I

    Joined:
    Oct 21, 2008
    Messages:
    41
    Likes Received:
    1
    Not really. I was telling you what I did at the start of the tutorial. :(

    Edit : Got it to work!
     
  3. jigg

    jigg Newbie

    Joined:
    Apr 19, 2010
    Messages:
    36
    Likes Received:
    2
    Location:
    Florida
    Cool, I DLed vb.net a few days ago, was going to see if I could possibly learn something, and this has helped tremendously, at least now I have a place to start.
     
  4. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    I know I've said it before, but great tutorial. absolutely super.

    Just one thing, and imo a pretty big thing...

    I think the login procedure has changed. For anyone wanting to make a program I think it is now a 1 line login in the form of Request("POST", "http://www.neopets.com/login.phtml?destination=%252Findex.phtml&username=" + user + "&password=" + pass, "http://www.neopets.com")

    can anyone tell me if this is how they do it now?

    thanks

    note: I know the old method does still work but would it be better to login in the most obvious fashion?
     
  5. Lightning

    Lightning Administrator
    Staff Member

    Joined:
    Nov 8, 2008
    Messages:
    3,021
    Likes Received:
    195
    Gender:
    Male
    Location:
    Florida, USA
    Yes Chelsea - that is the new way to log in.

    My method with my own wrapper looks like this:
    Code (Text):
    1.  
    2.             lblStatus.Text = "Visiting Neopets homepage...";
    3.             w.GetRequest("http://www.neopets.com/");
    4.             lblStatus.Text = "Typing credentials...";
    5.             m.Wait(750, 1500);
    6.             lblStatus.Text = "Logging in...";
    7.  
    8.             strHTML = w.PostRequest("http://www.neopets.com/login.phtml", "destination=%252Findex.phtml&username=" + strUser + "&password=" + strPass, "http://www.neopets.com/");
    9.  
     
  6. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    perfect, thanks lightning.

    can I ask how important threading is in vb.net programming? just having a play around with stuff and thinking I need it if I want to be able to do stuff like play with the gui while other processes are running
     
  7. Lightning

    Lightning Administrator
    Staff Member

    Joined:
    Nov 8, 2008
    Messages:
    3,021
    Likes Received:
    195
    Gender:
    Male
    Location:
    Florida, USA
    Threading is very important, especially because without it, normal events can cause the UI to freeze when you are making a web request because the event is running on the same thread that is managing the application's GUI. When you are using threading, however, the knowledge of delegates is important so that you can update controls as work is being done on your threads.

    The nice thing about the .NET Framework is that they have implemented the BackgroundWorker class, which is essentially threading with some delegates wrapped around it. You might want to look into as another alternative if you are just beginning programs - some people find it much less confusing. If you need any help with threading, feel free to ask me. :)
     
  8. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    thanks. what are my other alternatives by the way?
     
  9. Lightning

    Lightning Administrator
    Staff Member

    Joined:
    Nov 8, 2008
    Messages:
    3,021
    Likes Received:
    195
    Gender:
    Male
    Location:
    Florida, USA
    Well, besides a BackgroundWorker, there really isn't one. I'll PM you something that might help though.
     
  10. und3ad

    und3ad Level IV

    Joined:
    Feb 12, 2009
    Messages:
    886
    Likes Received:
    7
    Location:
    Montréal

    Well you don't /have/ to implement any threads....but it'll just suck xD