Response object

zhaozj2021-02-16  50

The Response object is actually executing the class httpresponse in the system.Web namespace. The CLR will establish a response object according to the user's request information, and Response will be used to respond to the customer's browser, tell the browser to respond to header, server-side status information, and output specified content. Response.contentType = ContentTypeContentType Property Set the output content type of the Response object. The default is that the text / html parameter contentTyPE is a string that describes its content type. This string format is type / subtype, Type represents the classification of the content, and the subType indicates that a specific content type response.contentType = "image / gif" means the input content type is a GIF graphic file. Response.clear () Method CLEAR method deletes HTML output in all caches. However, this method only deletes the response display input information and does not delete the response header information. Response.clearContent () method ClearContent and CLEAR method The ClearContent method is that the ClearContent method not only deletes the response display output information but also deletes the response header information response.clerheaders () method ClearHeaders method only deletes the header information, not deleting the response display output information response.expires = Number specifies the length of time that the page has failed in the browser cache. If the user returns to the same page before its failure, the page Number parameter in the cache indicates that the page expired time, the unit is minutes. Response.expiresabsolute = Date Time Sets the specific time of failure in the browser Cache of the page. If the user returns to the same page before its failure time, the version in Cache is displayed. If the date is specified, the page is not specified (TIME), the page is invalid at midnight. If the time is specified, the date in which the day is executed on the day of the script, response.expiresabsolute = datetime.now // instant expiration

The response.buffer = flagbuffer property indicates whether the page output is buffered. If there is a buffering, the service does not send the response to the client before all the statements on all currently processed pages, unless the Flush or End method is called the parameter flag indicates whether the page output is buffered. True means that False means it is not required. The default is TRUE

RESPONSE.FLUSH () method Immediately output buffer page

The response.end () method End mode causes the web server to stop the process of the current program and return the result. The remaining file content is not processed.

The response.write () method WRITE method outputs the specified text content. For example: Response.write ("Welcome to 8C8H.com")

The information specified by the response.binarywrite () method binarywrite method does not perform any string conversion directly to the current HTTP output. This method can be used to output non-character information, such as binary data required for some application requirements.

The response.writefile () method directly writes the output content into the response.writefile ("c: //8c8h.txt")

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

New Post(0)