答案:/*
*Author:tyfun
*DateTime:2002.12.19
*Package:com.westarsoft.function
*/
package com.westarsoft.io;
import java.lang.*;
import java.io.*;
public class Execute {
private static String cmdUrl = new String();
private static String fileParam = new String();
public String getCmdUrl() {
return cmdUrl;
}
public void setCmdUrl(String cmdUrl) {
this.cmdUrl = cmdUrl;
}
public String getFileParam() {
return fileParam;
}
public void setFileParam(String fileParam) {
this.fileParam = fileParam;
}
/*
*USE:
*setCmdUrl(String)
*setFileParam(String)
*/
public void exec(String cmdUrl,String fileParam) {
try {
String[] cmd = {cmdUrl, fileParam};
Runtime.getRuntime().exec(cmd);
}
catch(Exception e) {
System.out.println(e);
}
}
}
上一个:正确地封装Java类
下一个:再给大家一个进行IO操作的JAVABEAN,易做图奉献哦~~~~搜集和调试了很久,没有问题哦~~~~