如何强制应用程序池在经典 ASP 中回收(不使用 IIS 管理控制台)?

发布于 2024-09-17 12:22:58 字数 906 浏览 3 评论 0原文

我正在为一位朋友维护一个旧的经典 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执手闯天涯 2024-09-24 12:22:58

如果您更改 global.asa(例如添加空格),它将触发重新启动。
我目前通过 ASP.NET 代码完成此操作。

File.SetLastWriteTime(HttpContext.Current.Server.MapPath("~/global.asa"), DateTime.Now);

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.

File.SetLastWriteTime(HttpContext.Current.Server.MapPath("~/global.asa"), DateTime.Now);
心碎无痕… 2024-09-24 12:22:58

不。 ASP 没有系统级访问权限

no. ASP does not have system level access

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文