ASP.NET Common objects (Response object)

zhaozj2021-02-16  79

Request is used to respond to the browser, tell the browser to respond to the header, the status information of the server, and the output specified.

(1) Response.contentType = "text / html" Set the type of output content. The string format is Type / Subtype, Type represents the classification of the content, and the subType indicates a specific content type, and then the "Image / GIF" (2) response.clear () method deletes the HTML output in all cached. However, this method only deletes the response display output information and does not delete the response header information. (3) The response.clearContent () method is not only like the response display output information like the Clear () method, but also deletes Response header information. (4) The response.clearheader () method only deletes the response header information (5) response.expires = Number setting page Failure time in the browser cache (in minutes), if the user returns to the same one before it fails The picture shows the page in Cache. (6) Response.expiresabsolute = datetime Settings The specific time of failure in the browser cache. Example: response.expiresabsolute = datetime.now, indicating that it is too expiration. (7) Response.buffer = BOOL Settings The page is buffered. The default is True. If there is a buffering, the server does not send the Response statement to the client before the statement on the currently processed page, unless the flush () or end () method is called. (8) The response.flush () method immediately outputs the page in the mematic. (9) The response.end () method causes the web server to stop the current program and returns the result, and the remaining file content is not processed. (10) Response.write () method outputs the specified text content. Example: Response.write ("Hello!") (11) Response.binaryWrite () method The specified information does not perform character conversion, directly written to the current HTTP output. This method can be used from binary data from coming non-character data, such as certain applications. (12) The response.writefile () method directly writes the output content into a file. Example: Response.writefile ("D: //abc.txt") Note: The written file must exist before writing.

转载请注明原文地址:https://www.9cbs.com/read-15291.html

New Post(0)