skyit 发表于 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,$i = 1,$n,$x, $oIE
      $IE_Objects = 0
      
      While 1
                $oIE = _IEAttach ("", "instance", $i)
                If @error = $_IEStatus_NoMatch Then ExitLoop
                ReDim $IE_Objects[$i + 1]
                $IE_Objects[$i] = $oIE
                $IE_Objects = $i
                $i += 1
      WEnd
      ;MsgBox(0,"",$IE_Objects)
      ;;;========================================================
      For $n=1 To $IE_Objects
                $CurrentURL = _IEPropertyGet($IE_Objects[$n],"locationurl")
                ;MsgBox(0,"",$CurrentURL)
                For $x = 1 To $SourceUrls
                        If $CurrentURL=$SourceUrls[$x] or $CurrentURL=$SourceUrls[$x] & "/" Then _IENavigate($IE_Objects[$n],$TargetURL)
                Next
      Next
WEnd

Func _Exit()
      Exit
EndFunc

skyit 发表于 2011-5-11 05:53:31

没人知道吗!

qq82015930 发表于 2011-5-17 01:38:14

没看懂是什么{:face (382):}
页: [1]
查看完整版本: 希望可以做到不同域名调转到不同的网站!请高手