找回密码
 加入
搜索
查看: 4772|回复: 6

[系统综合] [已解决] 刷新注册表问题。请教谢谢了。

  [复制链接]
发表于 2011-12-13 02:52:22 | 显示全部楼层 |阅读模式
本帖最后由 pingfan5888 于 2011-12-14 15:49 编辑

RegWrite('HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings', 'EnableAutoProxyResultCache', 'REG_DWORD', '0x00000000')

RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings', 'AutoConfigURL', 'REG_SZ',  'file://' & @ScriptDir &'\proxy.pac')

;下面四条都不起作用。要自己手动选择IE选项确定后才会生效。请教各位。谢谢。

DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")
DllCall("shell32.dll","none","SHChangeNotify","long",0x8000000,"int",0,"ptr",0,"ptr", 0)
DllCAll("Userenv.dll","int","RefreshPolicyEx","int",1,"int",1)
EnvUpdate()
发表于 2011-12-13 09:07:48 | 显示全部楼层
EnvUpdate()
这个函数可能是更新的吧?
发表于 2011-12-13 11:52:01 | 显示全部楼层
EnvUpdate ( )


刷新操作系统的环境变量.
 楼主| 发表于 2011-12-14 08:14:48 | 显示全部楼层
我知道啊,就是这几种都对上面的代码没有效果,注册表是修改了,但是不能立即生效。哪位知道其他方法啊。。谢谢了。
发表于 2011-12-14 14:24:56 | 显示全部楼层
本帖最后由 wgboy 于 2011-12-14 15:01 编辑

LZ你看看Dallcall那句个可以吗?
$ip="192.168.1.1"
$port="8080"
_proxy($port,$ip)
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
Func _proxy($port,$ip)
        $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
    $objShare = $objWMIService.Get("Win32_Proxy.ServerName='computername'")
    $objInParam = $objShare.Methods_("SetProxySetting").inParameters.SpawnInstance_()
    $objInParam.Properties_.Item("ProxyPortNumber") = $port
    $objInParam.Properties_.Item("ProxyServer") = $ip
    $objOutParams = $objWMIService.ExecMethod("Win32_Proxy.ServerName='computername'", "SetProxySetting", $objInParam)
EndFunc
 楼主| 发表于 2011-12-14 15:37:59 | 显示全部楼层
LZ你看看Dallcall那句个可以吗?
wgboy 发表于 2011-12-14 14:24



    谢谢了。。这个DLLCALL,就行啊。学习了,有这类的资料吗。
发表于 2011-12-15 14:40:11 | 显示全部楼层
这个我也不是太懂,应该是API函数。你可以网上查下相关资料
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 05:27 , Processed in 0.081385 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表