Ill give you some of the code to make a easy login... You will code the rest! Ok. first thing to do is add the http wrapper, and moduels into the program.. or else it wont compile right! Make a textbox, label it txtuser, make another one right under it and label it txtpass. After you have done this, make a button.. label the button cmdlogin. After you have done this, Use this code.. I will break it up into pieces.. so you can understand it. (take out the spaces) Code (Visual Basic): <div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Private</span> <span style="color: #b1b100;">Sub</span> cmdLogin_Click<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Dim</span> strHTML <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strHTML = w.<span style="color: #66cc66;">PostWrapper</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"http://neopets .com/login.phtml"</span>, <span style="color: #ff0000;">"username="</span> & txtuser & <span style="color: #ff0000;">"&password="</span> & txtpass & <span style="color: #ff0000;">"&destination=%2Fpetcentral.phtml"</span>, <span style="color: #ff0000;">"http://neopets .com/hi.phtml"</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">If</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, strHTML, <span style="color: #ff0000;">"badpassword"</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">msgbox</span> <span style="color: #ff0000;">"Bad Password for account "</span> & txtuser.<span style="color: #66cc66;">Text</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">ElseIf</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, strHTML, <span style="color: #ff0000;">"This account has been"</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">msgbox</span> <span style="color: #ff0000;">"The account "</span> & txtuser.<span style="color: #66cc66;">Text</span> & <span style="color: #ff0000;">" has been frozen"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">ElseIf</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, strHTML, <span style="color: #ff0000;">"petcentral"</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">msgbox</span> <span style="color: #ff0000;">"Logged in as "</span> & txtuser.<span style="color: #66cc66;">Text</span></li></ol></div> Ok the first part is this: Code (Visual Basic): <div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Dim</span> strHTML <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">String</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strHTML = w.<span style="color: #66cc66;">PostWrapper</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"http://neopets .com/login.phtml"</span>, <span style="color: #ff0000;">"username="</span> & txtuser & <span style="color: #ff0000;">"&password="</span> & txtpass & <span style="color: #ff0000;">"&destination=%2Fpetcentral.phtml"</span>, <span style="color: #ff0000;">"http://neopets .com/hi.phtml"</span><span style="color: #66cc66;">)</span></li></ol></div> This part of the code is telling the wrappper (httpwrapper) to go to the neopets website and put in the parts of text it needs to log in. This is what it does.. in example if the txtuser is omgcat and the txtpass is omgcat http://neopets .com/login.phtml/username=omgcat&password=omgcat&destination=%2Fpetcentral.phtml Code (Visual Basic): <div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">If</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, strHTML, <span style="color: #ff0000;">"badpassword"</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">msgbox</span> <span style="color: #ff0000;">"Bad Password for account "</span> & txtuser.<span style="color: #66cc66;">Text</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">ElseIf</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, strHTML, <span style="color: #ff0000;">"This account has been"</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">msgbox</span> <span style="color: #ff0000;">"The account "</span> & txtuser.<span style="color: #66cc66;">Text</span> & <span style="color: #ff0000;">" has been frozen"</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">ElseIf</span> <span style="color: #b1b100;">InStr</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, strHTML, <span style="color: #ff0000;">"petcentral"</span><span style="color: #66cc66;">)</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">msgbox</span> <span style="color: #ff0000;">"Logged in as "</span> & txtuser.<span style="color: #66cc66;">Text</span></li></ol></div> This is telling the program to search the page and look for the words. and if it finds the specific word it will tell you if it has logged in or not. You have successfully made a login. TAKE OUT ALL OF THE SPACES INBETWEEN LINKS!!
It should also be noted that this is a detectable login method because it does not login in the two stages that a normal user would have to take. First entering their username, and then entering a password. Along with a few other reasons whose determination I'll leave as an exercise to the reader.
wow that helped a lot. i have been having trouble with my httpwrapper. what one do you use? thanks in advance. oh yeah. +rep (a million times if i could.)
Here is my new guide, it is more.. easier to understand XD ---- ^^ So you just want to start making neopets programs? You first need to know how to make a Login. The first thing you need to do is locate your Http Wrapper and your Sleep and stuff moduel. You need to make 2 textboxes.. make the name of one of them txtuser and the other one txtpass. (make two labels next to these, one username for txtuser and the other password next to txtpass) Make a Command button and name it CmdLogin and make its caption Login.. Now double click the form, and delete all code in there. And then paste this code into it. Code (Text): Private Sub cmdLogin_Click() Dim strHTML As String strHTML = w.PostWrapper("http://neopets .com/login.phtml", "username=" & txtuser & "&password=" & txtpass & "&destination=%2Fpetcentral.phtml", "http://neopets .com/hi.phtml") If InStr(1, strHTML, "badpassword") Then msgbox "Bad Password for account " & txtuser.Text ElseIf InStr(1, strHTML, "This account has been") Then msgbox "The account " & txtuser.Text & " has been frozen" ElseIf InStr(1, strHTML, "petcentral") Then msgbox "Logged in as " & txtuser.Text End If End Sub Now to check if it worked, go up to the top and press the play button. Type in username and password for a working account, frozen account, then a wrong password for an account.. Good luck! Take out spaces..
i cant put the wrapper in the form can i? and i can't change the name of the wrapper only the sleep and stuff module. sorry for being such a noob
I'm new to vb6 programming but I've had some experience with logins .. and yes, you do put it on the form. Click the wrapper on your sidebar and put it somewhere on your form.