我想制作一个程序来阻止任何文件(如 autorun.inf),以便其他程序无法在 Windows 中使用 C++ 读取它(就像一种方式,杀毒软件一样)。 请帮我。 谢谢。
最佳答案
您可以使用 dwShareMode
为 0 打开文件,这将
Prevents other processes from opening a file or device if they request delete, read, or write access.
因此,一旦您的进程打开该文件,其他进程将无法打开它、删除它等。
关于c++ - 阻止对文件的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5320566/