Alright, I'm kinda trying to learn fast so I'm going to type this post as quickly as possible. How do I have a button that carries out an action. For example: I am trying to make a "start" button to begin going through sponsor links. So, heres a small portion of the code I have: Code (Text): dim w as new tcpwrapper dim strhtml as string = w.getrequest(http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1, http://www.neopets.com/index.phtml) What I'm trying to do is for it to visit that link by pushing "start". And then, after that, I have a list of links for it to visit. Is there a way I can get it so that when someone pushes the "start" button it visits all of those links with a 4 second delay? Anyways, just telling me how to create a submit button is fine. Oh, and I don't want it to seem like I'm asking random questions. If anyone here knows a good forum for VB.net help, please do PM me. Thanks, Fexxel
first, put a new command button on your form. Double-click it to open the code. VB will automaticaly put all it needs to run what you want. Now, you don't need to declare the wrapper everytime. Just one time is fine. So the declaration won't be in any of the sub or function. You put it right before that (but still, in the main class). Now, I'll just explain a thing to you that may help. dim strhtml as string = w.getrequest("http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") In this line, you're declaring a variable containing strings and putting in it the result of the getrequest. For the sponsor, you don't need to see the result. The only time you want to see the result is if you need to extract some information from it. So this line is useless here. You can skip it. If you wish to keep it, do it but refer to first part of the post about variable declaration. So, for what you want to do, you can simply put in the code for your command button something like Code (Text): w.getrequest("http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=468", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=772", "http://www.neopets.com/index.phtml") w.pause(4) ... and so on
Code (Text): Error 2 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 54 43 Sponsor Doer Error 3 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 54 81 Sponsor Doer Error 5 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 56 9 Sponsor Doer Error 7 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 58 9 Sponsor Doer Error 9 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 60 9 Sponsor Doer Error 11 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 62 9 Sponsor Doer Error 4 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 55 9 Sponsor Doer Error 6 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 57 9 Sponsor Doer Error 8 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 59 9 Sponsor Doer Error 10 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 61 9 Sponsor Doer Error 1 ')' expected. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 54 41 Sponsor Doer I wanted to test the lines of code you gave me to make sure I was putting everything in the right place. Thats what happened. Also, if I'm trying to log the amount of NP someone has after going to a sponsor, should I then use the refer http://www.neopets.com/index.phtml? Finally, I don't really understand what you mean by how to make a button. I double clicked on a blank part of form1 and it opened up code, but it didn't create a button. I was wondering how to name a button and how to name the actual window? (I started with your login then expanded, but now it says NeoLogin)
Looks like you tried to paste my code into your project. just open neologin-updated.sln. This code is working. For the button, there's a panel on the left with all the kind of thing you can use. dumb Q: did you installed vb ??
1. Thanks, I figured out the button thing just now. 2. Yes, I have installed VB. I have VB express. ---- Now I have a new problem. I don't know how to read these errors: Code (Text): Error 1 ')' expected. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 54 41 Sponsor Doer Error 2 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 54 43 Sponsor Doer Error 3 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 54 81 Sponsor Doer Error 4 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 55 9 Sponsor Doer Error 5 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 56 9 Sponsor Doer Error 6 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 57 9 Sponsor Doer Error 7 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 58 9 Sponsor Doer Error 8 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 59 9 Sponsor Doer Error 9 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 60 9 Sponsor Doer Error 10 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 61 9 Sponsor Doer Error 11 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 62 9 Sponsor Doer Error 12 ')' expected. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 67 41 Sponsor Doer Error 13 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 67 43 Sponsor Doer Error 14 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 67 81 Sponsor Doer Error 15 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 68 9 Sponsor Doer Error 16 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 69 9 Sponsor Doer Error 17 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 70 9 Sponsor Doer Error 18 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 71 9 Sponsor Doer Error 19 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 72 9 Sponsor Doer Error 20 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 73 9 Sponsor Doer Error 21 'getrequest' is not a member of 'NeoLogin___Updated.TCPWrapper'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 74 9 Sponsor Doer Error 22 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 75 9 Sponsor Doer This is what I was trying to do: Code (Text): Public Sub fmrNeoLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim w As New TCPWrapper Dim strhtml As String = w.getrequest(http://www.neopets.com/objects.phtml, http://www.neopets.com/index.phtml) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=468", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("http://www.neopets.com/process_click.phtml?item_id=772", "http://www.neopets.com/index.phtml") w.pause(4) End Sub Just to see if I could get it to work, and then I'd replace the Urls. I was trying to get that to be the code for my "Start" button. Heres what my project works like right now: (Check attachments)
So... It should be this: Code (Text): Public Sub fmrNeoLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim w As New TCPWrapper Dim strhtml As String = w.getrequest(http://www.neopets.com/objects.phtml, http://www.neopets.com/index.phtml) w.getrequest("GET" "http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("GET" "http://www.neopets.com/process_click.phtml?item_id=7781&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("GET" "http://www.neopets.com/process_click.phtml?item_id=468", "http://www.neopets.com/index.phtml") w.pause(4) w.getrequest("GET" "http://www.neopets.com/process_click.phtml?item_id=772", "http://www.neopets.com/index.phtml") w.pause(4) End Sub ? Oh, by the way, check attachment for what I have so far ^^
Almost... the thing is that you shouldn't do this on form_load. This mean that as soon as the program is open, it will run this. Instead, put it on the button code (double click your "Pwnage" button and paste it there.) Second, you need to be logged in into neopets first. In the wrapper, you have a neologin function. Use it like this strhtml = w.neologin(username, password, false) After that, you can validate that you're logged in by checking the code in strhtml. See the solution I gave you for all the information. BTW, I'm using "response" instead of "strhtml" so don't be confuse.
1. So I should put down Code (Text): strhtml = w.neologin(username, password, false) before I type in the code? Because I just started, and I got 70 errors... These are the errors I got: Code (Text): Error 1 'lblStatus' is not a member of 'NeoLogin___Updated.fmrNeoLogin'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 58 9 Sponsor Doer Error 2 Name 'txtNFUser' is not declared. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 60 107 Sponsor Doer Error 3 Name 'txtNFPass' is not declared. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 60 139 Sponsor Doer Error 4 'lblStatus' is not a member of 'NeoLogin___Updated.fmrNeoLogin'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 74 13 Sponsor Doer Error 5 'lblStatus' is not a member of 'NeoLogin___Updated.fmrNeoLogin'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 76 17 Sponsor Doer Error 6 'lblStatus' is not a member of 'NeoLogin___Updated.fmrNeoLogin'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 82 13 Sponsor Doer Error 7 ')' expected. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 90 41 Sponsor Doer Error 8 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 90 43 Sponsor Doer Error 9 Syntax error. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 90 81 Sponsor Doer Error 10 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 91 9 Sponsor Doer Error 11 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 93 9 Sponsor Doer Error 12 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 95 9 Sponsor Doer Error 13 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 97 9 Sponsor Doer Error 14 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 99 9 Sponsor Doer Error 15 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 100 9 Sponsor Doer Error 16 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 101 9 Sponsor Doer Error 17 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 102 9 Sponsor Doer Error 18 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 103 9 Sponsor Doer Error 19 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 104 9 Sponsor Doer Error 20 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 105 9 Sponsor Doer Error 21 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 106 9 Sponsor Doer Error 22 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 107 9 Sponsor Doer Error 23 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 108 9 Sponsor Doer Error 24 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 109 9 Sponsor Doer Error 25 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 110 9 Sponsor Doer Error 26 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 111 9 Sponsor Doer Error 27 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 112 9 Sponsor Doer Error 28 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 113 9 Sponsor Doer Error 29 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 114 9 Sponsor Doer Error 30 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 115 9 Sponsor Doer Error 31 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 116 9 Sponsor Doer Error 32 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 117 9 Sponsor Doer Error 33 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 118 9 Sponsor Doer Error 34 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 119 9 Sponsor Doer Error 35 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 120 9 Sponsor Doer Error 36 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 121 9 Sponsor Doer Error 37 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 122 9 Sponsor Doer Error 38 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 123 9 Sponsor Doer Error 39 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 124 9 Sponsor Doer Error 40 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 125 9 Sponsor Doer Error 41 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 126 9 Sponsor Doer Error 42 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 127 9 Sponsor Doer Error 43 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 128 9 Sponsor Doer Error 44 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 129 9 Sponsor Doer Error 45 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 130 9 Sponsor Doer Error 46 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 131 9 Sponsor Doer Error 47 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 132 9 Sponsor Doer Error 48 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 133 9 Sponsor Doer Error 49 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 134 9 Sponsor Doer Error 50 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 135 9 Sponsor Doer Error 51 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 136 9 Sponsor Doer Error 52 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 137 9 Sponsor Doer Error 53 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 138 9 Sponsor Doer Error 54 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 139 9 Sponsor Doer Error 55 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 140 9 Sponsor Doer Error 56 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 141 9 Sponsor Doer Error 57 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 142 9 Sponsor Doer Error 58 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 143 9 Sponsor Doer Error 59 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 144 9 Sponsor Doer Error 60 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 145 9 Sponsor Doer Error 61 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 146 9 Sponsor Doer Error 62 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 147 9 Sponsor Doer Error 63 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 148 9 Sponsor Doer Error 64 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 149 9 Sponsor Doer Error 65 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 150 9 Sponsor Doer Error 66 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 151 9 Sponsor Doer Error 67 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 152 9 Sponsor Doer Error 68 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 153 9 Sponsor Doer Error 69 Argument not specified for parameter 'Referer' of 'Public Function Request(Method As String, URL As String, Referer As String) As String'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 154 9 Sponsor Doer Error 70 'NeoLogin___Updated.TCPWrapper.Private Shared Sub Pause(seconds As Double)' is not accessible in this context because it is 'Private'. C:\Users\Carter\Desktop\NeoLogin - Updated\NeoLogin - Updated\Form1.vb 155 9 Sponsor Doer Heres the full code I have: Code (Text): Imports System.Text.RegularExpressions Imports System.Net Imports System.IO Imports System.Text Imports System.IO.Compression Imports System.Runtime.Serialization.Formatters.Binary Public Class fmrNeoLogin Private Wrapper As New TCPWrapper Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click cmdLogin.Enabled = False txtUser.Enabled = False txtPass.Enabled = False If txtUser.Text = "" Or txtPass.Text = "" Then MsgBox("Username and/or password cannot be blank") cmdLogin.Enabled = True txtUser.Enabled = True txtPass.Enabled = True Else lstLog.Items.Add("Logging in...") lstLog.SelectedIndex = lstLog.Items.Count - 1 Application.DoEvents() Dim Response = Wrapper.NeoLogin(txtUser.Text, txtPass.Text, False) Application.DoEvents() If Response = "Logged In" Then lstLog.Items.Add("Logged in as " + txtUser.Text) cmdLogout.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 Else lstLog.Items.Add(Response) MsgBox("There was a problem logging in. See log for details") cmdLogin.Enabled = True txtUser.Enabled = True txtPass.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 End If End If End Sub Private Sub cmdLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogout.Click Wrapper.ClearCookies() cmdLogin.Enabled = True cmdLogout.Enabled = False lstLog.Items.Add("Logged Out") txtUser.Text = "" txtPass.Text = "" txtUser.Enabled = True txtPass.Enabled = True lstLog.SelectedIndex = lstLog.Items.Count - 1 End Sub Public Sub fmrNeoLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim bAuth As Boolean = False Dim bNewVersion As Boolean = False Dim ProgID As Integer = 222 'change to your program download id Dim ProgName As String = "Your Program Name v1.x" 'must be exactly the same as in the nf download section Me.lblStatus.Text = "Checking Authorization..." 'this auth uses mysticals wrapper, posted in the code snippets forum Dim strReturn As String = Wrapper.Request("GET", "http://www.neofriends.net/auth.php?username=" & txtNFUser.Text & "&password=" & txtNFPass.Text & "&program=" & ProgID, "http://www.neofriends.net/") If strReturn.Contains("Not Authorized to use the program") Then bAuth = False ElseIf strReturn.Contains("Authorized to use the program") Then bAuth = True If strReturn.Contains(ProgName) <> True Then bNewVersion = True End If Else bAuth = False 'some unknown error if we end up here End If If bAuth = True Then Me.lblStatus.Text = "Authorized!" If bNewVersion = True Then 'as long as you have the version as part of the progName, this check will work Me.lblStatus.Text = "New Version" MsgBox("Authorized! However it appears a new version of this program is now available. Please download the latest version!", MsgBoxStyle.Exclamation, "www.neofriends.net") Exit Sub 'you can remove this if you wish to let the user use the program even though it is not the latest version End If 'enable your controls here, now that the user is authorized Else Me.lblStatus.Text = "Failed Authorization" MsgBox("You are not authorized to use this program.", MsgBoxStyle.Exclamation, "www.neofriends.net") End If End Sub Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim w As New TCPWrapper Dim strhtml As String = w.getrequest(http://www.neopets.com/objects.phtml, http://www.neopets.com/index.phtml) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=4532&multiple=1&status=11&nc_value=3&noredirect=1") w.Request("GET", "http://www.neopets.com/neostatus.phtml?item_id=4543&multiple=1&status=11&nc_value=3&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.Request("GET", "http://www.neopets.com/neostatus.phtml?item_id=4543&multiple=1&status=11&nc_value=3&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.Request("GET", "http://www.neopets.com/neostatus.phtml?item_id=5426&multiple=1&status=11&nc_value=3&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.Request("GET", "http://www.neopets.com/neostatus.phtml?item_id=5446&multiple=1&status=11&nc_value=3&noredirect=1", "http://www.neopets.com/index.phtml") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=5652&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=5904&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=6104&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=6610&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=7192&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=7428&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=8063&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=8370&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=9087&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=9087&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=8438&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=8438&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/neostatus.phtml?item_id=8438&multiple=1&status=11&nc_value=3&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=8980&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=8980&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=8980&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=12097&r=49") w.pause(2) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=12097&r=49") w.pause(3) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=12097&r=49") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=1963&type_id=12&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=2792&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=2793&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=3184&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=4451&noredirect=1&r=49") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=4474&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=4492&noredirect=1") w.pause(4) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=4493&noredirect=1") w.pause(3) w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=4600&noredirect=1") w.pause(3) End Sub Private Sub lstLog_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstLog.SelectedIndexChanged End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Progress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Progress.Click End Sub End Class Public Class TCPWrapper Inherits System.Windows.Forms.UserControl #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'UserControl overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() components = New System.ComponentModel.Container End Sub #End Region Private colCookies As New Collection Dim strCookies As String Public LastPage As String Public Function Request(ByVal Method As String, ByVal URL As String, ByVal Referer As String) As String Dim Host As String = Nothing Dim strFile As String = Nothing Dim strPost As String = Nothing Dim pos As Integer = 0 If Referer Is Nothing Then Referer = LastPage End If If URL.Contains("http://") Then Host = URL.Substring(7) Else Host = URL End If If Host.Contains("/") Then pos = Host.IndexOf("/", 0) strFile = Host.Substring(pos) Host = Host.Substring(0, pos) Else strFile = "/" End If If Method = "POST" Then pos = strFile.IndexOf("?") If Not (pos = -1) Then strPost = strFile.Substring(pos + 1) strFile = strFile.Substring(0, pos) Else strPost = Nothing End If End If If Method = "POST2" Then pos = strFile.IndexOf("?") If Not (pos = -1) Then strPost = strFile.Substring(pos + 1) strFile = strFile.Substring(0, pos) Else strPost = "" End If End If LastPage = URL Dim ReqHeaders As String = Nothing If Method = "GET" OrElse Method = "PIC" Then ReqHeaders = "GET" + " " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" Else ReqHeaders = "POST " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Type: application/x-www-form-urlencoded" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Length: " + strPost.Length.ToString + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: close" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + strPost End If If Method = "PIC" Then ReqHeaders.Replace("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Accept: image/png,*/*;q=0.5") End If Dim tcp As New System.Net.Sockets.TcpClient Dim netstream As System.Net.Sockets.NetworkStream Dim TN(1) As Long If Referer = "" Then Referer = LastPage If InStr(1, URL, "http://") <> 0 Then Host = Mid$(URL, 8) If InStr(1, Host, "/") <> 0 Then Host = Mid$(Host, 1, InStr(1, Host, "/") - 1) If InStr(1, Host, "?") <> 0 Then Host = Mid$(Host, 1, InStr(1, Host, "?") - 1) LastPage = URL Try tcp.Connect(Host, 80) Catch ex As Exception Return ex.Message End Try Dim sendbytes As Byte() sendbytes = System.Text.Encoding.ASCII.GetBytes(ReqHeaders) netstream = tcp.GetStream() netstream.Write(sendbytes, 0, sendbytes.Length) Dim sr As StreamReader = New StreamReader(netstream, Encoding.Default) Dim strHTML As String = sr.ReadToEnd Dim strParts As String() = Regex.Split(strHTML, Environment.NewLine + Environment.NewLine) strCookies = ParseCookies(strParts(0)) If strParts(0).Contains("Content-Encoding") Then strParts(1) = DecompressGzip(strParts(1)) End If Return strParts(0) + Environment.NewLine + Environment.NewLine + strParts(1) End Function Public Function DecompressGzip(ByVal compressed As String) As String Dim memStream As MemoryStream = New MemoryStream(System.Text.Encoding.Default.GetBytes(compressed)) Dim decompressStream As GZipStream = New GZipStream(memStream, CompressionMode.Decompress) Dim endBytes(4) As Byte Dim position As Integer = CType(memStream.Length, Integer) - 4 memStream.Position = position memStream.Read(endBytes, 0, 4) memStream.Position = 0 Dim buffer(BitConverter.ToInt32(endBytes, 0) + 100) As Byte Dim offset As Integer = 0 Dim total As Integer = 0 While True Dim bytesRead As Integer = decompressStream.Read(buffer, offset, 100) If bytesRead = 0 Then Exit While End If offset += bytesRead total += bytesRead End While Return Encoding.ASCII.GetString(buffer) End Function Public Function ParseCookies(ByVal Headers As String) As String ParseCookies = "" Dim reg As Regex Dim matches As MatchCollection Dim match As Match reg = New Regex("set-cookie:\s*([^=]+)=([^;]+);", RegexOptions.IgnoreCase) If reg.IsMatch(Headers) Then matches = reg.Matches(Headers) For Each match In matches Try colCookies.Add(match.Groups(1).ToString & "=" & match.Groups(2).ToString, match.Groups(1).ToString) Catch ex As Exception colCookies.Remove(match.Groups(1).ToString) colCookies.Add(match.Groups(1).ToString & "=" & match.Groups(2).ToString, match.Groups(1).ToString) End Try Next End If Dim i As Long For i = 1 To colCookies.Count Step 1 ParseCookies = ParseCookies & colCookies.Item(i).ToString & ";" Next End Function Public Function StripHeaders(ByVal strSource As String) As String Dim strParts() As String = Regex.Split(strSource, Environment.NewLine + Environment.NewLine) Return strParts(1) End Function Public Function NeoLogin(ByVal user As String, ByVal pass As String, ByRef loggedIn As Boolean) As String Dim strHTML As String = Nothing Request("GET", "http://www.neopets.com/loginpage.phtml", "http://www.google.com") Pause(1) Request("POST", "http://www.neopets.com/hi.phtml?destination=%2Findex.phtml&username=" + user, "http://www.neopets.com/loginpage.phtml") Pause(1) strHTML = Request("POST", "http://www.neopets.com/login.phtml?username=" + user + "&password=" + pass + "&destination=%2Findex.phtml", "http://www.neopets.com/hi.phtml") If strHTML.Contains("Set-Cookie: neologin=") Then loggedIn = True Return "Logged In" Else If strHTML.Contains("too many times") Then loggedIn = False Return "To Many Login Attempts" Else If strHTML.Contains("badpassword") Then loggedIn = False Return "Wrong Username/Password" Else If strHTML.Contains("frozen") Then loggedIn = False Return "Account Frozen" Else If strHTML.Contains("just a technical problem") Then loggedIn = False Return "Neopets is down for maintenance" Else loggedIn = False Return "Unknow Error" End If End If End If End If End If End Function Private Shared Sub Pause(ByVal seconds As Double) Dim num As Double = seconds * 1000 Dim t1 As DateTime = DateTime.Now Dim t2 As DateTime = DateTime.Now Dim tmDiff As TimeSpan = t2 - t1 While Convert.ToDouble(tmDiff.TotalMilliseconds.ToString) < num t2 = DateTime.Now tmDiff = t2 - t1 Application.DoEvents() End While End Sub Public Function GrabPic(ByVal strURL As String) As System.Drawing.Image Dim memStream As New MemoryStream(System.Text.Encoding.Default.GetBytes(StripHeaders(Request("GET", strURL, LastPage)))) GrabPic = Image.FromStream(memStream) Return GrabPic End Function Public Sub ClearCookies() colCookies.Clear() strCookies = Nothing End Sub Public Function GetBetween(ByVal Source As String, ByVal Start As String, ByVal Finish As String) As String Dim Result = "" Dim A = InStr(1, Source, Start) + Len(Start) If A = 0 Then Result = "" Return Result Else Dim B = InStr(A, Source, Finish) If B = 0 Then Result = "" Return Result Else Result = Mid(Source, A, B - A) Return Result End If End If End Function Public Function GetRefCk(ByVal Source As String) As String Dim StringPosition = InStr(Source, "_ref_ck") Source = Source.Remove(0, StringPosition) StringPosition = InStr(Source, "value") Source = Source.Remove(0, StringPosition + 6) StringPosition = InStr(Source, ">") Source = Source.Remove(StringPosition - 2, Source.Length - (StringPosition - 2)) Return Source End Function End Class I don't get it lol. The url I put down (the request thing) shows up as underlined in red. It says that it's messed up (shows up in error console) What is the exact model for the url thing? This is what I am using: Code (Text): w.Request("get", "http://www.neopets.com/process_click.phtml?item_id=1963&type_id=12&noredirect=1") w.pause(3) So... w.request("get", "http://urlhere", "refer (not needed for my program since I'm not logging amount of NP)") (on a new line) w.pause (number of seconds here) Because it's just not working lol.
if you don't mind, zip the entire folder containing your code (I swear, I won't steal anything :lol and pm it to me... It's hard debugging something when we can't see the form. Some errors seems to be related to unproperly named items. I'll make the correction and put comments where I did the changes and why. On another note... when doing a request (get or post), you need to put "GET", URL, REFERER and the REFERER part is very important. To insure you're not cheating, TNT looks at the referer and if the referer is wrong or missing, you might end up with a 404 error. Referer as nothing to do with the fact that you want to check the code after. It NEEDS to be there. What you will analyse is the strhtml part in strhtml = w.request("GET",url,referer). That's why it's in red. It's missing something.
sometime, you can skip it and the code is suppose to fill it for you but it's not working and I'm too lazy to fix this. Futhermore, I prefer to manage them myself.
VB.net only capitalizes things for me... It gets annoying lol. Alright, I'm fixing the refer thing right now. Should I use http://www.neopets.com/index.phtml?
remove the ? at the end... I don't know what is the referer but I know that someone wrote a guide for firefox and he putted the right referer in it. In fact, if you don't use the right referer, you won't get any nps
The ? was for the question if that was the correct refer. I will go check the forums right now for the firefox guide. EDIT: I just went through every firefox guide on NF. Couldn't find the correct refer.
I couldn't find it :'( Good luck lol. I think I'll try to stay in 1 topic so... ---- for the progress bar .value = xxx what goes before the "."? w? (w is the variable I assigned to the wrapper) And also, if I have over 100 links, can I use decimals? for example: Code (Text): (what ever goes here).value = .5 ?
Thats too bad :'( Sweet! All I needa do is figure out the errors and finish adding the sponsor links! PWNAGE!