rinehart(rinehart) 真是高手,请指教一下如何改吧。
解决方案 »
- 查詢後以分頁顯示結果問題
- 很急!大侠帮忙!
- 有效期3个小时,抓紧..
- jsp提交的问题,有人能解决吗?
- 当页面一td内容变化时候更新另一个td内容
- 求weblogic9.2 linux版,紧急紧急
- 数据内容写入数据库后,如何原样取出来?
- jsp连接oracle为什么那么慢!
- hibernate annotation 怎么设置主键自动增长?sqlserver数据库
- 如何在hibernate层面上实现单向关联时删除主表记录时,从表记录也能删除?
- 怎么配置Jee2+Tomcat,我手头上有jakarta-tomcat-3.2.3和jdk-1_2_2_006-win?
- 如何用resultset来读取sqlserver的日期数据
没见过的让你们开开眼!
vbscript修改注册表:http://www.ccw.com.cn/htm/app/aprog/01_3_29_3.asp
javascript修改注册表:http://www.ccidnet.com/school/web/2001/07/09/70_4616.html
public class RegistryRead {
public static void main(String[] args) {
RegistryRead demo = new RegistryRead();
demo.doit();
// IO.PressAnyKey();
}
public void doit() {
displayUserName();
displayODBCDSN();
}
public void displayUserName(){
com.ms.wfc.app.RegistryKey regKey;
String userName;
regKey =
com.ms.wfc.app.Registry.LOCAL_MACHINE.getSubKey
("Network\\Logon");
if (regKey == null) {
userName = "Unable to get username from Registry!";
}
else {
userName = (String) regKey.getValue("username");
}
System.out.println("Username : " + userName);
} public void displayODBCDSN() {
com.ms.wfc.app.RegistryKey regKey;
regKey =
com.ms.wfc.app.Registry.CURRENT_USER.getSubKey
("Software\\ODBC\\ODBC.INI\\ODBC Data Sources");
if (regKey == null) {
System.out.println("Unable to get ODBC DSN Registry!");
}
else {
String dsn [] = regKey.getValueNames();
System.out.println("ODBC DSN defined : ");
for(int i = 0; i < dsn.length; i++) {
System.out.println(dsn[i]);
}
}
}
}
你所讲的javascript其实只是MS的JScript,而非,Netscape推出的JavaScript,两者在浏览器
乃至OS层的机理是不同的。
本来你如果要修改注册表,就意味着你使用ms的操作系统,有几个使用ms操作系统的人使用
Netscape?
所以你使用IE,必然会支持JScript!
^^
* @version 1.00 1997-07-01
* @author Cay Horstmann
*/import java.util.*;public class Win32RegKey
{ public Win32RegKey(int theRoot, String thePath)
{ root = theRoot;
path = thePath;
}
public Enumeration names()
{ return new Win32RegKeyNameEnumeration(root, path);
}
public native Object getValue(String name);
public native void setValue(String name, Object value); public static final int HKEY_CLASSES_ROOT = 0x80000000;
public static final int HKEY_CURRENT_USER = 0x80000001;
public static final int HKEY_LOCAL_MACHINE = 0x80000002;
public static final int HKEY_USERS = 0x80000003;
public static final int HKEY_CURRENT_CONFIG = 0x80000005;
public static final int HKEY_DYN_DATA = 0x80000006; private int root;
private String path; static
{ System.loadLibrary("Win32RegKey");
}
}class Win32RegKeyNameEnumeration implements Enumeration
{ Win32RegKeyNameEnumeration(int theRoot, String thePath)
{ root = theRoot;
path = thePath;
} public native Object nextElement();
public native boolean hasMoreElements(); private int root;
private String path;
private int index = -1;
private int hkey = 0;
private int maxsize;
private int count;
}class Win32RegKeyException extends RuntimeException
{ public Win32RegKeyException() {}
public Win32RegKeyException(String why)
{ super(why);
}
}
但能否告诉我setValue的用发 谢谢