Use httpRequest to log in to a website, then obtain the program example of the website information
Question: The content of some websites must be viewed after logging in, and its login information is saved in the session variable. In this way, components such as using Asphttp are difficult to properly get the information you want.
SOLUTION: Implemented using HttpRequest and HttpResponse in ASP.NET.
Important: 1. By attaching a cookieContainer to the HTTPRequest object, you can get the cookie of the representative session ID returned after logging. See the login method 2. This cookie is included in a cookieContainer and attached to another HttpRequest request, you can implement the SESSION restore. See getPage method
The source program is as follows:
Gethttpinfo.aspx: <% @ page language = "c #" codebehind = "gethtpinfo.aspx.cs" autoeventwireup = "false" inherits = "pdftest.gettttpinfo"%>
Webform1 title> head>