I. ASP. NET System Objects
Request: Used to get the values that the client sends during a Web request, such as URL parameters, form parameters
Response: The HTTP output used to return the negative to the client
Application: A state object that acts on the entire program runtime and can be used to hold configuration parameters for the entire application
Session state Hold Object
Cookie: How the client maintains session information
Server: Tool objects for server-side processing, such as URL encoding decoding, page forwarding
HttpContext: Encapsulates all HTTP-specific information about an individual HTTP request
Ii. object of Request
String ContentType: Gets or sets the MIME content type of the incoming request
HttpCookieCollection cookies: Get a collection of cookies sent by the client
Httpfilecollection files: Gets a collection of file uploads by the client
NameValueCollection form: Get the data submitted by the form
NameValueCollection Headers: Get HTTP Header Collection
NameValueCollection QueryString: Gets the HTTP query string variable collection
String RawUrl: Gets the original URL of the current request
NameValueCollection ServerVariables: Get a collection of Web server variables
String useragent: Gets the original user agent information for the client browser
String userhostaddress: Gets the IP host address of the remote client
String MapPath (stirng virtualpath): Maps the specified virtual path to a physical path
void SaveAs (String Filename,bool includeheaders): Saving an HTTP request to disk
third, Response object
String ContentType: Gets or sets the HTTP MIME type of the output stream
HttpCookieCollection cookies: Get Response cookie Collection
NameValueCollection Headers: Gets the collection of response headers
void Redirect (string url): Redirect request to new URL
void Write (string s): writes a string to the HTTP response output stream
Iv. Server Objects
String MapPath (String path): Returns the physical file path corresponding to the specified virtual path on the Web server
void Transfer (String path): page forwarding using the specified path
String UrlDecode (string s): URL decoding of a string
String UrlEncode (string s): URL encoding of a string
v. Object of the session
Syntax: session["Session name"]= value; Stored value
Variable =session["Session name"]; Take value
String SessionID: Contains a unique user session identifier that can be used to record user information throughout the session
int timeout: The time the user timed out, in minutes
void Abandon (): Ends session, cancels current session
void Add (String name,object Value): Add session data
void Remove (string name): Delete session data
In addition to the code setting timeout timeout, you can also use Web. config to configure the session
1 <system.web>2 <sessionstateTimeout= " the"cookieless= "true"Mode= "InProc"></sessionstate>3 <!--Omit other nodes -4 </system.web>5 <!--cookieless= "True": indicates that the client's session information is not dependent on a cookie but is passed through a URL6 cookieless= "false": indicates that the client is using a cookie to save SessionID7 mode: The default value of INPROC indicates that the session state remains dependent on the current ASP.8 stateserver and SQL Server: You can save the session on a state server or a database server -
VI. Cookie Object
Grammar:
The name of the Response.cookies[cookie]. value= variable value;//write Cookie
The name of the string variable name =request.cookies[cookie]. Value; Read cookies
The type of cookie corresponds to HttpCookie, so there is another way to add a new cookie:
HttpCookie Hccookie = new HttpCookie ("Name of the cookie", "value");
RESPONSE.COOKIES.ADD (Hccookie);
String Name:cookie The name of the object
String Value:cookie the contents of the object
DateTime Expires:cookie The effective time of the object, and if no valid date for the cookie is set, save to
When you close the browser program, set to DateTime.MaxValue to indicate that the cookie never expires
Vii. Objects of application
Grammar:
application["Application name"]= value; Stored value
Variable = application{"application name"]; Take value
Viii. objects of HttpContext
HttpApplicationState Application:application Object
HttpRequest Request:request Object
HttpResponse Response:response Object
HttpServerUtility Server:server Object
HttpSessionState Session:session Object
IPrincipal User:user Object
System.Web.Caching.Cache Cache:cache Object
Static HttpContext current: Gets or sets the System.Web.HttpContext object for the currently HTTP request
Eg:System.Web.HttpContext.Current.Response.Redirect ("~/");
Asp. NET System objects