[急]很多ASP.NET站點需要停掉,有沒有快速的方法?

吕津 2012-04-13 02:37:53
由於網站需要維護,需要暫停服務。我們希望用戶登入畫面時,系統強制跳轉到一個顯示網站維護中信息頁面。

不知道各位大俠有沒有辦法?

我依稀記得,只要在站點根目錄中放入一個HTML文件,就可以停掉。不過我記不起來這個文件的名字了。
...全文
193 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
吕津 2012-04-23
  • 打赏
  • 举报
回复
吕津 2012-04-14
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 的回复:]
app_offline.htm 只影响aspx的页面 如果请求是xx。htm或xx。html就不会跳到app_offline.htm
[/Quote]

你錯了,可以的!!
吕津 2012-04-14
  • 打赏
  • 举报
回复

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>系统升级公告</title>
<style type="text/css">
body{padding:0;margin:0;text-align:center;color:#000;font-size:24px;font-family:'微软雅黑';}
</style>
</head>
<body>
<div style="vertical-align:middle; height:100%;">
<fieldset style="text-align:center; ">
<legend style="font-weight:bold;">系統升級公告</legend>
<h2 style="font-size:20px;">
請注意SAP(ERA)系統會於以下時間暫停服務:<br />
<span style="color:red;">4月14日(六)下午3時至4月15日(日)下午5時</span><br />
上述時段需暫停使用SAP及相關的網頁系統,請知悉並通知相關同事。
</h2>
</fieldset>
<br /><br />
<fieldset style="text-align:center; ">
<legend style="font-weight:bold;">System upgrade announcement</legend>
<h2 style="font-size:20px;">
Please be informed that the SAP Production System (ERA) will suspend its service within the following period. <br />
We’re performing the system upgrade.<br />
<span style="color:red;">14 April 2012 15:00 – 15 April 2012 17:00</span><br />
Within this period, the SAP systems will disable the login of all users and suspend all batch jobs.<br />
We are sorry for inconvenient caused. Pls. inform who will be affected.
</h2>
</fieldset>
</div>
</body>
</html>

happytonice 2012-04-14
  • 打赏
  • 举报
回复
把要通知的信息做成一个页面,放在一个文件夹里,从站点上直接把目录换到这个地方就行了
fihuang 2012-04-14
  • 打赏
  • 举报
回复
iis里可以设置一个默认的页面
Echo_Smilly 2012-04-13
  • 打赏
  • 举报
回复
app_offline.htm 只影响aspx的页面 如果请求是xx。htm或xx。html就不会跳到app_offline.htm
anzhiqiang_touzi 2012-04-13
  • 打赏
  • 举报
回复
在站点根目录放一个
app_offline.htm

文件名字必须是这个,不能改
文件
内容是
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>系统升级公告</title>
<style>
html{padding:0;margin:0;}
body{padding:0;margin:0;text-align:center;color:#000;font-size:24px;font-family:'微软雅黑';
background-image: linear-gradient(left, green, orange, yellow);
background-image: -moz-linear-gradient(left, green, orange, yellow, green);
background-image: -o-linear-gradient(left, green, orange, yellow, green);
background-image: -webkit-linear-gradient(left, green, orange, yellow);
}
h1{padding:20px 0;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#008000,endColorStr=#FF8C00;}
</style>
</head>
<body>
<h1 style="margin-top:10%;color:blue;">系统升级公告</h1>
<h2>

为了提供更好的服务,16:00至16:30之间将进行一次简短的升级,届时平台将不能浏览和内容的发布,敬请谅解。

</h2>

</body>
</html>

fxxyz 2012-04-13
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
在站点根目录放一个
app_offline.htm

文件名字必须是这个,不能改
文件
内容是
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<tit……
[/Quote]

+1
moonwrite 2012-04-13
  • 打赏
  • 举报
回复
還有,如果僅僅希望停掉部分頁面,有沒有好的辦法?

实现和伪静态一样 重新路由

如果请的是abc.aspx 那么重定向到 abc.htm(只说已经停止了)

然后配置希望停掉的部分 重定向到 abc.htm
孟子E章 2012-04-13
  • 打赏
  • 举报
回复
對於ASP.NET 1.1的程序, 你可以修改404页面显示的内容。把整个文件夹重命名
不能停掉部分页面,只能按照站点停止
吕津 2012-04-13
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]
引用 2 楼 的回复:
在站点根目录放一个
app_offline.htm

文件名字必须是这个,不能改
文件
内容是
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2……
[/Quote]

所以,如果對於ASP.NET 1.1的程序,我們該怎麽辦呀?

還有,如果僅僅希望停掉部分頁面,有沒有好的辦法?
ycproc 2012-04-13
  • 打赏
  • 举报
回复
知道CSDN 也有这样的维护吗?

您可以 玩玩 :“看看你能坚持几秒”
szjarvis 2012-04-13
  • 打赏
  • 举报
回复
这个方法不错。
popule_daisy 2012-04-13
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
在站点根目录放一个
app_offline.htm

文件名字必须是这个,不能改
文件
内容是
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<tit……
[/Quote]

app_offline.htm的作用:

当在ASP.NET 2.0的站点的根目录下添加一个app_offline.htm后,你的站点就可以停止了,所有的对aspx文件的请求都会取消,而且页面会定位在app_offline.htm页面。当你在对应用程序做大规模的升级或对数据库更新的时候这个页面将会为您提供极大的方便,从这一点上可以看到ASP.NET 2.0的又一项细致入微的工作。
情天玄月 2012-04-13
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
在站点根目录放一个
app_offline.htm
文件
内容是
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>系统升级公告</title>……
[/Quote]
不错,顶!
想念旧时光 2012-04-13
  • 打赏
  • 举报
回复
在web.confing里面好像能配置、当服务器停了之后显示的文件。
Mirror然 2012-04-13
  • 打赏
  • 举报
回复
我记得08年的地震那会 很多站打开 都是一个页面提示
网站在更新 或者 维护的时候 做一个友好界面提示就OK了 不管怎么访问都映射到这个页面
不影响什么
孟子E章 2012-04-13
  • 打赏
  • 举报
回复
在站点根目录放一个
app_offline.htm

文件名字必须是这个,不能改
文件
内容是
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>系统升级公告</title>
<style>
html{padding:0;margin:0;}
body{padding:0;margin:0;text-align:center;color:#000;font-size:24px;font-family:'微软雅黑';
background-image: linear-gradient(left, green, orange, yellow);
background-image: -moz-linear-gradient(left, green, orange, yellow, green);
background-image: -o-linear-gradient(left, green, orange, yellow, green);
background-image: -webkit-linear-gradient(left, green, orange, yellow);
}
h1{padding:20px 0;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#008000,endColorStr=#FF8C00;}
</style>
</head>
<body>
<h1 style="margin-top:10%;color:blue;">系统升级公告</h1>
<h2>

为了提供更好的服务,16:00至16:30之间将进行一次简短的升级,届时平台将不能浏览和内容的发布,敬请谅解。

</h2>

</body>
</html>

smputao 2012-04-13
  • 打赏
  • 举报
回复
直接关了服务器

62,266

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧