本文介绍了Session_OnEnd没有DeleteFile()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个ASP3(IIS6)站点,其中一些脚本需要生成 临时文件才能工作。现在,事实是:我希望在用户的会话结束时删除那些 临时文件(即使我已经获得了无限的托管空间) ,我觉得留下GB的无用的临时文件有点不礼貌;-))。 然而,Session_OnEnd事件似乎有这样做的一些问题: 1.我在MSDN中发现它无法调用Server.MapPath()。不是很大的问题,我对基本路径进行了硬编码,一切都运行良好。 2.然而,FileSystemObject.DeleteFile()方法似乎受到了影响 同样的问题:我在Session.Abandon()上没有输出错误,但文件 仍在那里。 是有没有解决这个问题的方法? 提前谢谢 Andrea Azzini 解决方案 您的IWAM_machinename帐户需要更改文件夹的权限。 Bob Barrows - Microsoft MVP - ASP / ASP.NET 请回复新闻组。我的From 标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。 您的IWAM_machinename帐户需要更改文件夹的权限。 Bob Barrows - Microsoft MVP - ASP / ASP.NET 请回复新闻组。我的From 标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将得到更快的回复。 您的IWAM_machinename帐户需要更改文件夹的权限。 Bob Barrows - Microsoft MVP - ASP / ASP.NET 请回复新闻组。我的From 标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。 - Microsoft MVP - ASP / ASP.NET 请回复新闻组。我的From 标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。 I''ve got an ASP3 (IIS6) site, in which some scripts need to generatetemporary files in order to work. Now, the fact is: I would like thosetemporary files to be deleted when a user''s session ends (even though i''vegot infinite hosting space, i feel it somewhat impolite to leave GB''s ofuseless temp files ;-) ).The Session_OnEnd event, though, seems to have some problems in doing this:1. I found in MSDN that it couldn''t call Server.MapPath(). Not a bigproblem, I hardcoded the base path and everything should have worked well.2. The FileSystemObject.DeleteFile() method, though, seems to suffer fromthe same problem: i get no error output on Session.Abandon() but the filesare still there.Is there any workaround for this problem?Thanks in advanceAndrea Azzini 解决方案Your IWAM_machinename account needs Change permissions for the folder.Bob Barrows--Microsoft MVP -- ASP/ASP.NETPlease reply to the newsgroup. The email account listed in my Fromheader is my spam trap, so I don''t check it very often. You will get aquicker response by posting to the newsgroup. Your IWAM_machinename account needs Change permissions for the folder. Bob Barrows -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don''t check it very often. You will get a quicker response by posting to the newsgroup. Your IWAM_machinename account needs Change permissions for the folder. Bob Barrows -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don''t check it very often. You will get a quicker response by posting to the newsgroup.--Microsoft MVP -- ASP/ASP.NETPlease reply to the newsgroup. The email account listed in my Fromheader is my spam trap, so I don''t check it very often. You will get aquicker response by posting to the newsgroup. 这篇关于Session_OnEnd没有DeleteFile()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 07:46