使用Java在Windows上隐藏文件/文件夹 [英] Make a File/Folder Hidden on Windows with Java
本文介绍了使用Java在Windows上隐藏文件/文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
对于Java 6及更低版本,
您将需要使用本机调用,这里是Windows的一种方式
Runtime.getRuntime ().exec(attrib + H myHiddenFile.java);
您应该了解一下有关win32-api或Java Native的信息。
I need to make files and folders hidden on both Windows and Linux. I know that appending a '.' to the front of a file or folder will make it hidden on Linux. How do I make a file or folder hidden on Windows?
解决方案
For Java 6 and below,
You will need to use a native call, here is one way for windows
Runtime.getRuntime().exec("attrib +H myHiddenFile.java");
You should learn a bit about win32-api or Java Native.
这篇关于使用Java在Windows上隐藏文件/文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文