如何强制应用程序池在经典 ASP 中回收(不使用 IIS 管理控制台)?
我正在为一位朋友维护一个旧的经典 ASP 站点,该站点托管在廉价的共享主机上。他们遇到的错误可以通过应用程序池回收来解决。
但是,托管控制面板没有任何类型的选项来回收应用程序池,并且托管公司本身对支持请求没有响应。
有没有办法让IIS从ASP本身回收应用程序池?我可以更改 global.asa 中的某些内容或任何会触发回收的内容吗?我有 FTP 访问权限,仅此而已。
更新:问题已解决
@Schotime 的回答是正确的。他的代码在 asp.net 中,我想我应该发布我在 aspfaq.com
<%
Sub Touch(FolderPath, FileName, NewDate)
Set app = CreateObject("Shell.Application")
Set folder = app.NameSpace(FolderPath)
Set file = folder.ParseName(FileName)
file.ModifyDate = NewDate
set file = nothing
set folder = nothing
set app = nothing
End Sub
Call Touch(Server.MapPath("/"), "somefile.htm", "2005-09-01")
Call Touch("C:\", "somefile.txt", "2012-01-01")
%>
I am maintaining an old Classic ASP site for a friend that is hosted on a cheap shared host. They are getting errors that will be solved with an Application Pool recycle.
However, the hosting control panel doesn't have any sort of options to recycle the app pool and the hosting company themselves are non-responsive to support requests.
Is there any way to cause IIS to recycle the app pool from ASP itself? Can I change something in the global.asa or anything that would trigger a recycle? I have FTP access and that is about it.
UPDATE: PROBLEM SOLVED
@Schotime's answer was right on. His code was in asp.net, I thought I would post the VBscript equivalent code that I found on aspfaq.com
<%
Sub Touch(FolderPath, FileName, NewDate)
Set app = CreateObject("Shell.Application")
Set folder = app.NameSpace(FolderPath)
Set file = folder.ParseName(FileName)
file.ModifyDate = NewDate
set file = nothing
set folder = nothing
set app = nothing
End Sub
Call Touch(Server.MapPath("/"), "somefile.htm", "2005-09-01")
Call Touch("C:\", "somefile.txt", "2012-01-01")
%>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您更改 global.asa(例如添加空格),它将触发重新启动。
我目前通过 ASP.NET 代码完成此操作。
If you change the global.asa (eg. add a space) it will trigger a restart.
I do it through code from ASP.NET at the moment.
不。 ASP 没有系统级访问权限
no. ASP does not have system level access