62,046
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RestartWeb.aspx.cs" Inherits="MainSuper.WebSites.Tools.RestartWeb"
Buffer="false" EnableViewState="false" EnableSessionState="False" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
if (Request["restart"] == null) {
Response.Write("web stoping...<br />");
HttpRuntime.UnloadAppDomain();
Response.Write("web stoped.<br />");
System.Threading.Thread.Sleep(1000);
Response.Write("web starting...<br />");
try {
System.Net.WebRequest.Create(Request.Url + "?restart=false").GetResponse();
Response.Write("web started.<br />");
} catch (Exception ex) {
Response.Write("error:" + ex.Message);
}
}
%>
</div>
</form>
</body>
</html>