Skip to content

Instantly share code, notes, and snippets.

@Pietjan
Created August 3, 2015 08:32
Show Gist options
  • Select an option

  • Save Pietjan/2a600cc1c4b3b5f5fe40 to your computer and use it in GitHub Desktop.

Select an option

Save Pietjan/2a600cc1c4b3b5f5fe40 to your computer and use it in GitHub Desktop.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
lblMessage.Text = "";
}
protected void btnRestart_Click(object sender, EventArgs e)
{
if (txtPassword.Text.Trim().ToUpper() ==
System.Configuration.ConfigurationManager.AppSettings["ResetApplicationPoolPassword"].ToString().Trim().ToUpper())
{
string webConfigPath = Server.MapPath("~/Web.config");
System.IO.File.SetLastWriteTime(webConfigPath, DateTime.Now);
Session.Abandon();
Response.Redirect("/");
}
else
lblMessage.Text = "Ongeldig Wachtwoord";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Reset ApplicationPool</title>
</head>
<body>
<form id="aspnetForm" runat="server">
Password:
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:Button ID="btnRestart" runat="server" Text="Restart" OnClick="btnRestart_Click">
</asp:Button>
<asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment