The automatic login site has a key place to be the correct or not of the parameter name, because the parameter names received by each web server are not the same, if the parameter name is incorrect, it will be misunderstood Therefore, it is recommended to recommend a very useful tool "Visual Sniffer": it can intercept the TCP / IP / UDP / ICMP and other data packets transmitted through the network, and use this tool to easily get the relevant parameters sent to the server.
Take the 9CBS as an example. Now let's open "http://www.9cbs.net/member/mme/login.asp "9cbs" http://www.9cbs login page, enter the account number, do not log in, run the Visual Sniffer, point Let's "start intercept" this button, then return to the landing page, click "Login", wait a moment, after login success, click "Stop Interception" on Visual Sniffer, now you can find some IE to send some what. (It is recommended to turn off excess IE before doing these, because if other IE windows are also sending data, you will be unnecessary interference in Visual Sniffer.)
Note that there are many " " numbers on the left side of Visual Sniffer, which is the data that is intercepted, launched them one by one, then check the data on the right, if the first line does not have "post" such a character, Then quickly change a " ", which is the fastest way to send data to the 9CBS server (our login is "post" request, if you see "get", it is certainly not). Please see the actual picture:
First, let's send out the file header, there are a few not very important, so there is not much to say:
"Accept:" indicates the file format that can be received.
"Referr:" indicates the file address pointed to.
"Accept_language:" indicates the language accepted.
"Host:" indicates the host name.
The purple line portion in the figure is in the picture, which is the address sent by the POST. The red line is either all the servers need to receive parameters, four equal numbers indicate that the total four parameters are "&" connects. By the way, the cookie: aspsession you see ... long this is a session, which is sent by the server when IE and the server requests the connection, and now returned to it. You can check out elsewhere in Visual Sniffer, when it's getting. Due to the program, we use the control, do not need to consider the problem of cookie and session, because VB's INET, WebBrowser is packaged very well, the key is how to use it correctly.
"Login_name", "password" is the most important parameter name received when 9CBS is logged in; in addition, there is a "cookietime" to tell the local cookie's effective time, these three are parameters that must be sent when landing 9CBS . The account and password are the parameters required for the general landing site, but some servers receive more than three parameters. In addition to the account and password, we can use other parameters as a third parameter, and the "&" connection is used. In addition, it is more important to "Content-Type: Application / X-WWW-FORM-URLENCODED", tell the server to decode the way, if there is less, you can't do anything.