Process process = Runtime.getRuntime().exec("cmd /c dir c:");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process,getInputStream(),"GBK"));
String line = bufferedReader.readLine();
这样就不会乱码了
Process process = Runtime.getRuntime().exec("cmd /c dir c:");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process,getInputStream(),"GBK"));
String line = bufferedReader.readLine();
这样就不会乱码了
转载于:https://www.cnblogs.com/sg-yys/p/11089993.html