⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getexplore.java

📁 一个基于NetBeans平台开发的
💻 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 + -