Context, which refers to an environment.
In software engineering, context is an ordered sequence of attributes that define an environment for objects residing within the environment. The context is created during the activation of the object, and the object is configured to require certain automated services such as synchronization, transactions, real-time activation, security, and so on. As in computer technology, the context is the process execution environment relative to the process. Specifically, the variables and data, including all the register variables, process open files, memory information, and so on.
HttpContext
Its interior consists mainly of two members, one is request, and one is response (response). After it is generated by httpruntime, it is passed into the HttpApplication. Then execute the HttpApplication processrequest () method. Enter more than 20 pipeline events and finally return the contents of the server response to the browser.
A context is a class that encapsulates information about each user session, the current HTTP request, the requested page, and so on.
This makes instances of these classes available as internal objects that are accessed from code. The following is the inner object of the context and the class that generated the instances.
reponse: provides access to the output stream of the current page. You can use this class to insert text into a page, write a cookie, and so on.
Request : provides access to the current page requests, including request headers, cookies, client certificates, query strings, and so on. You can use this class to read what the browser has already sent.
Context: provides access to the entire current context, including the request object. You can use this type of information between shared pages.
Server: exposes a tool method that you can use to transfer controls between pages, get messages about the latest errors, encode and decode HTML text, and so on.
Application: provides access to methods and events for all sessions within an application scope. It also provides application-wide access to the cache of information available for storage.
Session : provides information for the current user session. It also provides a session-wide cache access for storing information, and a way to control how the session is managed.
Trace: provides a way to display system and custom trace diagnostic messages in the HTTP page output.
The context should be a variety of resources used by the program to run, when multiple programs run, the system will allocate time for each program, the program is not completed within the specified time (slice), the system should save its context, so that the next time (slice) come when the original running state of the program can be quickly restored. It should be a static object for a program or a child thread.
Context in the computer