易截截图软件、单文件、免安装、纯绿色、仅160KB

XP系统下Java修改文件或文件夹属性的代码。

 2009-11-09  15:33:36
文件属性配置类
package cn.sist.file;
public class FileProperty {
private int sysProperty = 0;
private int hiddenProperty = 0;
private int readProperty = 0;
private int arriveProperty = 0;
private boolean changeAll = false;


public FileProperty setChangeAll(boolean changeAll){
this.changeAll = changeAll;
return this;
}

public boolean getChangeAll(){
return this.changeAll;
}
protected int getArriveProperty() {
return arriveProperty;
}
public FileProperty addArriveProperty() {
this.arriveProperty = 1;
return this;
}
public FileProperty removeArriveProperty(){
this.arriveProperty = 2;
return this;
}
protected int getHiddenProperty() {
return hiddenProperty;
}
public FileProperty addHiddenProperty() {
this.hiddenProperty = 1;
return this;
}
public FileProperty removeHiddenProperty(){
this.hiddenProperty = 2;
return this;
}
protected int getReadProperty() {
return readProperty;
}
public FileProperty addReadProperty() {
this.readProperty = 1;
return this;
}
public FileProperty removeReadProperty(){
this.readProperty = 2;
return this;
}
protected int getSysProperty() {
return sysProperty;
}
public FileProperty addSysProperty() {
this.sysProperty = 1;
return this;
}
public FileProperty removeSysProperty(){
this.sysProperty = 2;
return this;
}
}

文件修改类
package cn.sist.file;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class FilePropertyChange {
private static final String xpCommand = "cmd /c attrib";
private static final String[] xpSysProperty = {"","+s","-s"};
private static final String[] xpHiddenProperty = {"","+h","-h"};
private static final String[] xpArriveProperty = {"","+a","-a"};
private static final String[] xpReadOnlyProperty = {"","+r","-r"};
/*
* defaultFileProperty onl


相关文档:

java入门

 Java学习从入门到精通 
一、 JDK (Java Development Kit) 
JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握JDK是学好Java的第一步。最主流的J ......

java的那些事:实现学生信息录入和查看

本程序可以实现学生信息录入和查看。
要求:
(1)利用Swing设计图形用户界面,界面包括:学生信息录入和显示学生信息;
(2)添加学生信息:实现往集合里添加学生信息(学号,姓名,性别,成绩)
      注意:用户输入信息的验证。
(3)修改学生信息:由用户输入学生的学号,程序验证是否有此学生 ......

非诚勿扰:2010应届毕业生 java程序员


个人简历
个人信息
姓名


朱金国
 
     
性别



出生日期

1988

1

9

                   
Email

zhujinguo2009@gmail.com
  ......

Java Card开发常用的包(整理)

 整理了一下常用到的Java卡开发包里的方法,以后就能加快开发速度了。
//Java Card开发方法查询
import java.lang.*;
import javacard.framework.*;
import javacard.security.*;
import javacardx.crypto.*;     //该包为扩展包
//install方法
public static void install(byte[] bArray, ......

java循环遍历map

JDK1.4中
Map map = new HashMap();
Iterator it = map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Object key = entry.getKey();
Object value = entry.getValue();
}
JDK1.5中,应用新特性For-Each循环
Map m = new HashMap();
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号