package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class test {
/**
* @param args
* @throws InterruptedException
* @throws IOException
* @throws IOException
* @throws InterruptedException
*/
public static int fileToRar(String aimpath,String realPath) throws InterruptedException {
StringBuffer cmd= new StringBuffer("c:/Program Files/WinRAR/Rar.exe");//安装的winrar路径
cmd.append(" a -ep ");
cmd.append(aimpath);
cmd.append(realPath);
Process proc;
try {
proc = Runtime.getRuntime().exec(cmd.toString());
BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream(), "gbk"));
String line;
while ((line = br.readLine()) != null) {
//System.out.println(line);
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载
- 1
- 2
- 3
前往页