gpt4 book ai didi

c# - 如何使正在运行的可执行文件删除自己的文件

转载 作者:太空狗 更新时间:2023-10-29 22:28:32 24 4
gpt4 key购买 nike

例如,

我有一个可执行的 TrashClean.exe 正在运行。我希望它删除我不想要的所有文件,并在最后一步删除自身(硬盘驱动器上的 TrashClean.exe)。

我想知道在 C# 中是否可行?

最佳答案

请参阅How To Make Your Application Delete Itself Immediately :

I'm sure you've all said to yourself or someone at the office at one point or another, "<snort> You idiot. Don't you know a Windows application can't delete itself? I bet you don't even know how to type high ASCII characters using the ALT key and the number pad, gahhhh.."

Sure, there are ways to have a file delete itself on the next reboot... And you can even resort to an external program or batch file to do the work. But I just came up with a nifty way of doing it without leaving a visible trace that the application ever existed!

关于c# - 如何使正在运行的可执行文件删除自己的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5303783/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com