第一種方法 InternetExplorer.Application
StartURL = "www.49028c.com" set IE = CreateObject("InternetExplorer.Application") IE.Visible = true IE.Navigate StartURL
第二種方法 WScript.Shell
dim Wsh Set Wsh=WScript.CreateObject("WScript.Shell") On error Resume Next objeShell.Run("http://www.baidu.com")
下面的代碼就是自動打開百度并輸入武林網進行搜索的代碼
Dim wsh,ie Set wsh = CreateObject("wscript.shell") Set ie = WScript.CreateObject("InternetExplorer.Application") URL="http://www.baidu.com" code="武林網" ie.visible = True ie.navigate URL WScript.Sleep 1000 wsh.AppActivate "百度一下,你就知道 " ' 引號中填瀏覽器最上面的標題 wsh.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide wsh.SendKeys "^v" wsh.SendKeys "{ENTER}"
用vbs實現網站自動登錄
Dim wsh,ie Set wsh = CreateObject("wscript.shell") Set ie = WScript.CreateObject("InternetExplorer.Application") URL=" http://www.baidu.com" ie.visible = True ie.navigate URL WScript.Sleep 1000*5 wsh.AppActivate " " ' 引號中填瀏覽器最上面的標題 WScript.Sleep 1000*1 wsh.SendKeys "帳號" '引號中填帳號 WScript.Sleep 1000*1 wsh.SendKeys "{TAB}" WScript.Sleep 1000*1 wsh.SendKeys "密碼" '引號中填密碼 WScript.Sleep 1000*1 wsh.SendKeys "{ENTER}"
好了,內容就介紹到這,希望大家以后多多支持武林網。
新聞熱點
疑難解答