void Application_Error(object sender,EventArgs e) { //Code that runs when an unhandled error occurs Exception Ex = Server.GetLastError().GetBaseException(); if (ex.GetType() == typeof(System.IO.FileNotFoundException)) { Response.Redirect("Default404.aspx"); } }
using System; using System.ServiceProcess; ServiceController sc = new ServiceController("W3SVC"); Response.Write(sc.Status.ToString());
<authentication mode="Forms"> <forms loginUrl = "~/Login.aspx" slidingExpiration = "true" timeout = "20" /> </authentication>
Response.Status = "301 Moved Permanently"; Response.AddHeader("Location", "/new_page.aspx/"); Response.End();
Response.RedirectPermanent("new_page.aspx",true);
Response.Write(Request.ServerVariables["SERVER_SOFTWARE"]);
using System.Windows.Forms; protected void Page_Load(object sender, EventArgs e) { string Server_Name = String.Empty; Server_Name = SystemInformation.ComputerName; }
string url = Request.UrlReferrer.ToString();
string previous_page_url = Request.UrlReferrer.ToString();
btnClose.Attributes.Add("OnClick","window.close();");
string CurrentURL = Request.Url.AbsoluteUri;
string[] Directories = System.IO.Directory.GetDirectories(Server.MapPath("~/"));