package JNIRegistry;
import com.ice.jni.registry.RegStringValue;
import com.ice.jni.registry.Registry;
import com.ice.jni.registry.RegistryException;
import com.ice.jni.registry.RegistryKey;
public class CheckDefaultBrowserImpl implements ICheckDefaultBrowser{
public String getDefaultBorserPath() {
try {
Registry registry = new Registry();
registry.debugLevel=true;
RegistryKey regkey = Registry.HKEY_CLASSES_ROOT;
RegistryKey key =registry.openSubkey(regkey,"http\\shell\\open\\command",RegistryKey.ACCESS_ALL);
RegStringValue stringValue = (RegStringValue)key.getValue("");
return stringValue.getData();
}
catch(RegistryException ex) {
ex.printStackTrace();
return null;
}
}
public String getDefaultBrowserName() {
// TODO Auto-generated method stub
try {
Registry registry = new Registry();
registry.debugLevel=true;
RegistryKey regkey = Registry.HKEY_CLASSES_ROOT;
RegistryKey key =registry.openSubkey(regkey,"http\\shell\\open\\ddeexec\\Application",RegistryKey.ACCESS_ALL);
//I suppose there is a javaci value at Software\\Microsoft\\CurrentVersion\\Explorer\\Advanced
// RegStringValue stringValue = new RegStringValue(key,"b",RegistryValue.REG_SZ);
RegStringValue stringValue = (RegStringValue)key.getValue("");
System.out.println(stringValue.getData());
return stringValue.getData();
}
catch(RegistryException ex) {
ex.printStackTrace();
return null;
}
}
public void setDefaultBorwserName(String name) {
try {
Registry registry = new Registry();
registry.debugLevel=true;
RegistryKey regkey = Registry.HKEY_CLASSES_ROOT;
RegistryKey key =registry.openSubkey(regkey,"http\\shell\\open\\ddeexec\\Application",RegistryKey.ACCESS_ALL);
//I suppose there is a javaci value at Software\\Microsoft\\CurrentVersion\\Explorer\\Advanced
// RegStringValue stringValue = new RegStringValue(key,"b",RegistryValue.REG_SZ);
RegStringValue stringValue = (RegStringValue)key.getValue("");
stringValue.setData(name);
key.setValue(stringValue);
}
catch(RegistryException ex) {
ex.printStackTrace();
}
}
public void setDefaultBrowserPath(String path) {
try {
Registry registry = new Registry();
registry.debugLevel=true;
RegistryKey regkey = Registry.HKEY_CLASSES_ROOT;
RegistryKey key =registry.openSubkey(regkey,"http\\shell\\open\\command",RegistryKey.ACCESS_ALL);
//I suppose there is a javaci value at Software\\Microsoft\\CurrentVersion\\Explorer\\Advanced
// RegStringValue stringValue = new RegStringValue(key,"b",RegistryValue.REG_SZ);
RegStringValue stringValue = (RegStringValue)key.getValue("");
stringValue.setData("\""+path+"\"");
System.out.println(stringValue.getData());
key.setValue(stringValue);
}
catch(RegistryException ex) {
ex.printStackTrace();
}
}
}
lengfeng847
- 粉丝: 4
- 资源: 8
最新资源
- GVC-全球价值链参与地位指数,基于ICIO表,(Wang等 2017a)计算方法
- 易语言ADS指纹浏览器管理工具
- 易语言奇易模块5.3.6
- cad定制家具平面图工具-(FG)门板覆盖柜体
- asp.net 原生js代码及HTML实现多文件分片上传功能(自定义上传文件大小、文件上传类型)
- whl@pip install pyaudio ERROR: Failed building wheel for pyaudio
- Constantsfd密钥和权限集合.kt
- 基于Java的财务报销管理系统后端开发源码
- 基于Python核心技术的cola项目设计源码介绍
- 基于Python及多语言集成的TSDT软件过程改进设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈