Displays information about the web server environment that hosts the current web page.
Assembly: System.Web.Helpers (in System.Web.Helpers.dll)
Thetype exposes the following members.
This class represents a helper, which is a component that simplifies web programming in ASP.NET Web Pages. You can use the class to troubleshoot issues with a website during development and testing. For example, the class can be used to display the virtual and physical paths of the pages in your application, which can help diagnose path-related issues in your code. The class includes many other types of information about the server environment that can be useful in solving programming or site issues, such as the identity of the logged-in user on the current web page, which version of Windows is running on the server, which HTTP method was used to request a web page (GET or POST), and so on.
To display information about the server, call the GetHtml method. The method displays information about the server in a series of HTML tables.
Because the class displays important information about your server that includes its operating system, the physical path of website files, and security information, you should remove any references to the class before you publish a web page to a production server.
The class provides the following kinds of information about the web server:
Local time on the server, machine name, operating system version, user name, current directory, processor count.
ASP.NET server variables
Physical path of the web application, path of the current web page, logon user identity, server protocol, HTTP request method, web server name, URL of the page.
HTTP runtime information
Path of key directories like Bin and the .NET Framework CLR directory, ASP.NET installation directory, cache size, and machine configuration directory.
Web site name, path of key system folders such as the Program Files and Windows installation directory, user domain name, operating system, value of the path variable on your computer.
This example shows how to call the GetHtml method to display information about the server. Because the class is static, you do not have to create an instance of the class before you call the method.