jsp 如何改写注册表

xiaoxiangyy 2001-08-29 01:59:16
...全文
318 21 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
skyyoung 2001-08-30
  • 打赏
  • 举报
回复
http://www.trustice.com/java/jnireg/
xiaoxiangyy 2001-08-29
  • 打赏
  • 举报
回复
路人甲,感谢你的方法
但能否告诉我setValue的用发 谢谢
slade 2001-08-29
  • 打赏
  • 举报
回复
已经有几种方法,看来应该可以修改注册表。
kare 2001-08-29
  • 打赏
  • 举报
回复
/**
* @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);
}
}
秦岭刀客 2001-08-29
  • 打赏
  • 举报
回复
好笨!用VC做一个ActiveX控件,用javascript调用ocx,不就可以改了吗?
rinehart 2001-08-29
  • 打赏
  • 举报
回复
不过例子比较少,好像大部分使用JavaScript修改注册表的都是病毒!
^^
fatpig521 2001-08-29
  • 打赏
  • 举报
回复
有理!:)
rinehart 2001-08-29
  • 打赏
  • 举报
回复
只要浏览器支持就可以了!
本来你如果要修改注册表,就意味着你使用ms的操作系统,有几个使用ms操作系统的人使用
Netscape?
所以你使用IE,必然会支持JScript!
fatpig521 2001-08-29
  • 打赏
  • 举报
回复
rinehart(rinehart):
你所讲的javascript其实只是MS的JScript,而非,Netscape推出的JavaScript,两者在浏览器
乃至OS层的机理是不同的。
skyyoung 2001-08-29
  • 打赏
  • 举报
回复
Read the Registry
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]);
}
}
}
}

rinehart 2001-08-29
  • 打赏
  • 举报
回复
ok!
没见过的让你们开开眼!
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
tiangou 2001-08-29
  • 打赏
  • 举报
回复
说了半天,屁都没解决一个!
xiaoxiangyy 2001-08-29
  • 打赏
  • 举报
回复
fatpig521 2001-08-29
  • 打赏
  • 举报
回复
JavaScript够呛。
fatpig521 2001-08-29
  • 打赏
  • 举报
回复
用VBScript可能会行。
kellychen 2001-08-29
  • 打赏
  • 举报
回复
gz
raindays 2001-08-29
  • 打赏
  • 举报
回复
你要是会改我服你。
hexiaofeng 2001-08-29
  • 打赏
  • 举报
回复
呵呵,吹牛吧??? 我认为不可能的!!!
sharetop 2001-08-29
  • 打赏
  • 举报
回复

rinehart(rinehart) 真是高手,请指教一下如何改吧。


xiaoxiangyy 2001-08-29
  • 打赏
  • 举报
回复
如何改?
加载更多回复(1)

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧