📄 getexplore.java
字号:
package com.sinpool.rivercrescent.io;
import java.io.*;
public class GetExplore{
private static String REG_PATH = "reg query HKEY_CLASSES_ROOT\\htmlfile\\shell\\open\\command";
public static String getExploreCommand() {
String ecom = "";
try {
Process process = Runtime.getRuntime().exec(REG_PATH);
StreamReader reader = new StreamReader(process.getInputStream());
reader.start();
process.waitFor();
reader.join();
String result = reader.getResult();
ecom = result;
ecom = ecom.substring(ecom.indexOf("\"")+1,ecom.lastIndexOf("\""));
}
catch (Exception e) {
return null;
}
return ecom;
}
public static void main(String[] args) {
System.out.println(GetExplore.getExploreCommand());
}
static class StreamReader extends Thread {
private InputStream is;
private StringWriter sw;
StreamReader(InputStream is) {
this.is = is;
sw = new StringWriter();
}
public void run() {
try {
int c;
while ((c = is.read()) != -1)
sw.write(c);
}
catch (IOException e) { ; }
}
String getResult() {
return sw.toString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -