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
相关文档:
本程序可以实现学生信息录入和查看。
要求:
(1)利用Swing设计图形用户界面,界面包括:学生信息录入和显示学生信息;
(2)添加学生信息:实现往集合里添加学生信息(学号,姓名,性别,成绩)
注意:用户输入信息的验证。
(3)修改学生信息:由用户输入学生的学号,程序验证是否有此学生 ......
/************Student.java begin***************/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Student {
private String name;
private String password;
public String getName() {
return name;
}
public ......
个人简历
个人信息
姓名
:
朱金国
性别
:
男
出生日期
:
1988
年
1
月
9
日
Email
:
zhujinguo2009@gmail.com
  ......
example: 求5的阶乘。。
如下:
public class Test {
static int multiply(int n){
if(n==1||n==0)
return n;
else
return n*multiply(n-1);
}
public static void main(String[] args){
System.out.println(multiply(10));
}
......
RMI(Remote Method Invocation)
RMI是分布式对象软件包,它简化了在多台计算机上的JAVA应用之间的通信。
必须在jdk1.1以上
RMI用到的类
java.rmi.Remote 所有可以被远程调用的对象都必须实现该接口
java.rmi.server.UnicastRemoteObject 所有可以被远程调用的对象都必须扩展该类
什么是RMI
远程方法调用是 ......