清理临时文件_清理您的临时文件

清理临时文件

清理临时文件

I was doing some tidying up on a website for a family friend recently. His ASP.NET application was taking longer and longer to start up. It also happened to use a lot of XmlSerializers, and of course, as an ASP.NET app, there's a lot of page-by-page compilation as he's not on 2.0 and doesn't use aspnet_compiler.

最近,我在一家朋友的网站上进行整理。 他的ASP.NET应用程序花费的时间越来越长。 它也碰巧使用了很多XmlSerializers,当然,作为ASP.NET应用程序,有很多逐页编译,因为他不在2.0上并且不使用aspnet_compiler。

Additionally, there's some code that this client wrote that writes out temp files but doesn't clean up after themselves. When there's this many files in a folder, calls to GetTempFileName can block for many seconds.

此外,此客户端编写了一些代码,这些代码写出了临时文件,但它们自身并未清除。 当文件夹中有这么多文件时,对GetTempFileName的调用可能会阻塞许多秒钟。

Not only can "excessive temp file growth" cause pain at runtime, but it'll easily crush Explorer.exe's usefulness. It'll also become impossible to apply Attributes to the folder.

“过度的临时文件增长”不仅会在运行时引起痛苦,而且还很容易破坏Explorer.exe的用途。 将属性应用于文件夹也将变得不可能。

The point is, that there's a few folders that you need to watch out for file growth in.

关键是,您需要注意一些文件夹以防止文件增长。

I like to modify the options inside Microsoft Drive Cleanup using Shawn A. Van Ness's registry file. You can extensively modify what appears in the Drive Cleanup list, even adding your own file types and your own application-specific directories and files that you might want cleaned up.

我想使用Shawn A. Van Ness的注册表文件修改Microsoft Drive Cleanup中的选项。 您可以广泛修改“驱动器清除”列表中显示的内容,甚至可以添加自己的文件类型以及自己想要清除的特定于应用程序的目录和文件。

Check out your own systems...drop out to a command prompt (cmd.exe) and do:

检查您自己的系统...退出到命令提示符(cmd.exe)并执行以下操作:

  • cd %tmp% and cd %temp% - You'll usually end up in C:\DOCUME~1\username\LOCALS~1\Temp.

    cd%tmp%和cd%temp% -您通常会以C:\ DOCUME〜1 \ username \ LOCALS〜1 \ Temp结尾。

    • At this point, I like to do the equivalent of a deltree and go up a directory and:

      在这一点上,我喜欢做一个deltree的等效工作,并转到一个目录并:
      • cd ..

        光盘..
      • rd Temp /s (it usually won't manage to delete the whole dir. Someone will have a file open and the final directory deletion will fail)

        rd Temp / s(通常无法删除整个目录。有人将打开文件,并且最终目录删除将失败)
      • md Temp (in case it was deleted.)

        md Temp(以防删除。)

  • Everything in %windir%\temp - There's lots of Perfmon counters in here, so you won't be able to delete everything. Often you can del *.* and anything that shouldn't be deleted is currently open.

    %windir%\ temp中的所有内容-这里有很多Perfmon计数器,因此您将无法删除所有内容。 通常,您可以删除*。*,并且任何不应该删除的内容都处于打开状态。

  • If you are a developer, and have developed ASP.NET for years/months, clean up %windir%\Microsoft.NET\Framework\ <VERSION> \Temporary ASP.NET Files. I had 4 dozens sites in here.

    如果您是开发人员,并且已经开发ASP.NET多年/月,请清理%windir%\ Microsoft.NET \ Framework \ <VERSION> \ Temporary ASP.NET文件。 我在这里有四个打点。

Tidy up, my friends.

整理一下,我的朋友们。

翻译自: https://www.hanselman.com/blog/clean-up-your-temp-files

清理临时文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值