import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class GetReg {
public static void main(String[] args) {
try {
Process ps = null;
ps = Runtime.getRuntime().exec("reg query HKEY_LOCAL_MACHINE\\SOFTWARE\\360Safe\\360Scan");
ps.getOutputStream().close();
InputStreamReader i = new InputStreamReader(ps.getInputStream());
String line;
BufferedReader ir = new BufferedReader(i);
while ((line = ir.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
注意,上面的\\不要写为/
信息:
HKEY_LOCAL_MACHINE\SOFTWARE\360Safe\360Scan timedelay REG_DWORD 0x0 SectionCount REG_DWORD 0x0