Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大家好,我正在使用 CreateNewFile() 函数制作一个 .txt 文件,我使用 System32 目录中的以下代码将其隐藏。
Process p = Runtime.getRuntime().exec("attrib +h " + f.getPath()); p.waitFor();
该文件已成功隐藏但我需要它是安全的,这样即使您想删除它也无法删除。有没有办法以编程方式实现这一目标?
I don't think so你能行的。每个文件都可以在 Windows 中以某种方式删除(以安全模式启动)。
I don't think so
唯一的方法是Username在创建文件时使用。You can not delete file created by other user unless you are administrative.
Username
You can not delete file created by other user unless you are administrative.
您将在 java 中找到更多信息不可删除文件夹