Assembly: System.Web (in system.web.dll)
/** @property */ public int get_StatusCode () /** @property */ public void set_StatusCode (int value)
Property ValueAn Integer representing the status of the HTTP output returned to the client. The default value is 200 (OK).
StatusCode is set after the HTTP headers have been sent.
The following code example is an ASP.NET page that uses the StreamWriter class to write the values of three HttpResponse class properties to a text file: the StatusCode property, the StatusDescription property, and the Charset property. The code first creates a constant, named INFO_DIR, that contains the path and part of the file name for the text file. A counter is then created that is used to generate unique file names for each response. Next, the code references a StreamWriter object that will write the information about the request to the file.
The code then calls the WriteLine method to write the time the response was generated, and then writes the property values to the file. The code then closes the StreamWriter object.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.