the key to automatic site logon is whether the parameter name is correct, because Web the parameter names received by the server cannot be the same. If the parameter names are incorrect in Programs , it will mistakenly think that the error of Code is annoying, therefore, we recommend a very useful tool " visual sniffer ": it can intercept TCP/IP/udp/ICMP and other data packets, using this tool, you can easily obtain relevant parameters sent to the server. To log on Csdn For example, we use IE Open" Http://www.csdn.net/member/login.asp " Csdn Enter the account and password on the login page. Visual sniffer Click "Start interception", return to the login page, and click "login". Wait a moment. Visual sniffer Click "Stop interception". Now you can find IE What exactly has been sent out. (We recommend that you add unnecessary IE All are disabled, because if other IE The window is also sending data, and you will Visual sniffer Is not necessary .) Note that Visual sniffer There are many" + ", These are the intercepted data. expand them one by one. In this case, check the data on the right. If there is no" Post "This character, then quickly change to" + ", Which is already the fastest way to find Csdn (Our login is" Post "Request, if you see" Get ). See the actual image: First, I would like to give a brief description of the issued file headers. There are a few of them that are not very important, so I will not talk about them here: "Accept: "Indicates the format of the file that can be received. "Referer: "Indicates the address of the file to which the object is directed. "Accept_language: "Indicates the language accepted. "Host: "Indicates the host name. The purple line section in the figure is Post The address to which the request is sent. The red line shows the parameters that all servers need to receive. The four equal signs indicate that there are four parameters in total: & Connect. By the way, the one you see Cookie : Aspsession ...... The long section is Session , It is in IE When connecting to a server request, the server sends IE Is returned again. You can Visual sniffer In other places to check and see when it is obtained. In the program, we use controls, which do not need to be considered. Cookie And Session Because VB Of Inet , Webbrowser They are encapsulated well. The key is how to use them correctly. " Login_name "," Password "These two are Csdn The most important parameter name received during login; in addition, there is a" Cookietime "Tell local Cookie Valid time of, these three are Login Csdn Parameters that must be sent. The account and password are generally required for login to the site, but some servers will receive more than three parameters. Apart from the account and password, we can count all other parameters as the third parameter, use" & "Connect. What's more important is" Content-Type: Application/X-WWW-form-urlencoded ", Here we will tell the server the decoding method. If this sentence is missing in the program, nothing can be done. Log on to other forums, mailboxes,CommunityYou can use Visual sniffer To obtain Post And this is the method I recommend to you, especially when some parameters are not as easy Html When the source file is analyzed. In addition, you can use this method to intercept your programs, because HTTP Protocol, Visual sniffer It can also be intercepted. In this way, you can compare the program IE What are the similarities and differences during login to achieve the goal of debugging. |