如何在java程序中设置文件为“隐藏”属性

[复制链接]
查看11 | 回复1 | 2013-10-9 15:40:27 | 显示全部楼层 |阅读模式
Java代码public class 设置文件属性 { // 执行以下代码你将看到一个属性为隐藏的文件(D:\ddd.ddd) // 请到D盘下查看 public static void main(String[] args) throws IOException { // 创建新文件 File file = new File("D:\\ddd.ddd"); // 删除文件并创建新文件 file.delete(); file.createNewFile(); // 拼dos命令 // attrib的祥细功能介绍请在DOS内输入 " attrib /? " 查看 String sets = "attrib +H \"" + file.getAbsolut...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行