I've looped over the Request.ServerVariables
collection in ASP.NET, but it's not as comprehensive as phpinfo()
.
How can I print all that information, including server software, drivers, etc, for ASP.NET?
An empty page with this header should do the trick:
<%@ Page Trace="true" Language="C#"
ContentType="text/html" ResponseEncoding="utf-8" %>
http://code.google.com/p/aspnetsysinfo/
The project is a ASP.Net System Information Prober. It's a single page which trying to get as much as possible of useful hosting information. The concept is similar to PHP page which contains
phpinfo()
...
ServerInfo.GetHtml()
is basically the same as phpinfo()
. Not only is the actual returned information extremely similar but also the html presentation. Here is a live demo!
You can also use it even if you're only making a pure Web API app, but letting a controller return a HttpResponseMessage
like so:
public System.Net.Http.HttpResponseMessage Get()
{
var serverinfo = System.Web.Helpers.ServerInfo.GetHtml().ToHtmlString();
var response = new System.Net.Http.HttpResponseMessage();
response.Content = new System.Net.Http.StringContent("<html><body>" + serverinfo + "</body></html>");
response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/html");
return response;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With