C # Analog Website Login

Source: Internet
Author: User

To implement this feature, you need to use some grab tools to analyze the corresponding website landing process, depending on the site, it may be complex, or it may be simple. Common grab tools ff under Firebug and IE under the httpwatch. These two tools are powerful and the information obtained by this tool is sufficient to respond to the information required by C # to simulate the site's landing process. The use of the Grab kit tool online A lot, such as Firebug tutorial, here do not do too much introduction. Of course, on-line C/S structure simulation website Landing information is also many, but the basic code snippets or logic is very complex. So write down the process of my practice and share it with you. The experimental process is based on a simulated landing in the school.

First use Firebug to obtain information about the landing, before the point to log in the Firebug information to clear, so that the information obtained from the click on the login button to start, for subsequent analysis, such as:

The link between each request and the next request is the cookie data returned after each request, and the previous return cookie data needs to be sent to the server together with the next request, which is the key to the C # simulation website landing. See the following logic code:

View Code

Here is the test code, POST request once, get request three times. Finally get the HTML code to load the home page after landing. Of course, you can get the other sub-page HTML of the website based on the current cookie data after landing. The following is the logic of the HTML code that loads the home page after landing.

View Code

The first post data URL is the page to submit data, this address may not be available in the Capture tool, which requires analysis, many methods (online many), such as viewing the landing page source code.


The data submitted by post can be obtained from the capture tool, and the following information is available in Firebug:

Copy the code to execute the following, the automatic login success!!

All right, that's all, this process is that each request continues the application of the previous request to return the cookie data, as long as this principle is understood, this process is not difficult.

C # Analog Website Login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.