易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

cookie技术在Java ME平台的应用与实现

转自: http://www.j2medev.com/Article/ShowArticle.asp?ArticleID=4465 
Cookie在Web应用程序中被广泛采用,维护浏览器和服务器之间的状态。遗憾的是这一特性在Java ME平台中并没有得到支持。因此,要想维持客户端和服务器端的状态则必须使用URL重写的方式。URL重写操作起来比较麻烦,所以研究一下cookie的原理并在 ......

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 webservice 服务器代码获取请求客户端的IP地址

 package test;
import javax.annotation.Resource;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
@javax.jws.WebService(targetNamespace = "http://test/", serviceName = "Web ......

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();
......

Java RMI分布式应用程序概述

 
RMI(Remote Method Invocation)
RMI是分布式对象软件包,它简化了在多台计算机上的JAVA应用之间的通信。
必须在jdk1.1以上
RMI用到的类
java.rmi.Remote 所有可以被远程调用的对象都必须实现该接口
java.rmi.server.UnicastRemoteObject 所有可以被远程调用的对象都必须扩展该类
什么是RMI
远程方法调用是 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号