找回密码
 加入
搜索
查看: 2123|回复: 2

[AU3基础] 希望可以做到不同域名调转到不同的网站!请高手

[复制链接]
发表于 2011-4-30 21:20:39 | 显示全部楼层 |阅读模式
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\tools\ICO\The Icons\Network.ico
#AutoIt3Wrapper_outfile=urltz.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#NoTrayIcon
#include<IE.au3>
Opt("MustDeclareVars",1)
;au3监控IE地址栏网址自动路转
Global $ConfigFile = @ScriptDir & "\urltz.ini"
Global $CurrentURL,$SourceUrls,$TargetURL
Global $DefaultTargetURL = "http://www.hao123.com"

Dim $MyVersion = "au3urltz"
If WinExists($MyVersion) Then Exit
AutoItWinSetTitle($MyVersion)

HotKeySet("#{F9}","_Exit") ;设置全局快捷键(Windows徽标键+F9退出程序)

$SourceUrls = IniReadSection($ConfigFile,"SourceURL")
$TargetURL = IniRead($ConfigFile,"TargetURL","TargetURL",$DefaultTargetURL)

While 1
        Sleep(300)
        ;;;=======================================================
        ;;;得到所有IE窗口
        Dim $IE_Objects[1],$i = 1,$n,$x, $oIE
        $IE_Objects[0] = 0
        
        While 1
                $oIE = _IEAttach ("", "instance", $i)
                If @error = $_IEStatus_NoMatch Then ExitLoop
                ReDim $IE_Objects[$i + 1]
                $IE_Objects[$i] = $oIE
                $IE_Objects[0] = $i
                $i += 1
        WEnd
        ;MsgBox(0,"",$IE_Objects[0])
        ;;;========================================================
        For $n=1 To $IE_Objects[0]
                $CurrentURL = _IEPropertyGet($IE_Objects[$n],"locationurl")
                ;MsgBox(0,"",$CurrentURL)
                For $x = 1 To $SourceUrls[0][0]
                        If $CurrentURL=$SourceUrls[$x][1] or $CurrentURL=$SourceUrls[$x][1] & "/" Then _IENavigate($IE_Objects[$n],$TargetURL)
                Next
        Next
WEnd

Func _Exit()
        Exit
EndFunc
 楼主| 发表于 2011-5-11 05:53:31 | 显示全部楼层
没人知道吗!
发表于 2011-5-17 01:38:14 | 显示全部楼层
没看懂是什么
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-21 05:50 , Processed in 0.075007 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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