此技術經常使用於購物導航搜索,如淘寶網購物上的商品搜索自動提示功能:
var ie=WScript.createobject("InternetExplorer.Application");
var args = WScript.arguments;
var followme="http://www.89900.com";
if(args.length>0)
{
followme+=args(0);
}
ie.Navigate("https://www.google.com/accounts/Login?continue="+followme);
SynchronizeIE();
var doc=ie.document;
doc.forms[0].Email.value="lixianmin@gmail.com";
doc.forms[0].Passwd.value="密碼寫在這裏";
//這是由於PersistentCookie這個checkbox有時候有而有時候沒有。
if(doc.forms[0].PersistentCookie!=null)
{
doc.forms[0].PersistentCookie.checked=false;
}
doc.forms[0].submit();
SynchronizeIE();
ie.Visible=true;google
//等待IE操做結束。
function SynchronizeIE()
{
while(ie.Busy)
{
WScript.Sleep(100);
}
}
假定把該文件保存爲googleSpecific.js,存放在%windir%\system32路徑下,並創建以下內容的一個google.bat文件一樣放在%windir%\system32路徑下。.net
@cls命令行
@wscript %windir%\system32\googleSpecific.js %1 %2 %3 %4 %5 %6 %7 %8 %9orm
而後,在命令行執行語句:go mail,就能夠直接登錄到你的gmail了。ip