網站制作之C#語言技術網站制作之C#語言技術,網頁表單自動填寫實現:
var ie=WScript.createobject("InternetExplorer.Application");
var args = WScript.arguments;
var followme="/";
if(args.length>0)
{
followme+=args(0);
}
ie.Navigate("https:///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;
//等待IE操縱結束。
function SynchronizeIE()
{
while(ie.Busy)
{
WScript.Sleep(100);
}
}
假定把該文件保存為googleSpecific.js,存放在%windir%\system32路徑下,并建立如下內容的一個google.bat文件同樣放在%windir%\system32路徑下。
@cls
@wscript %windir%\system32\googleSpecific.js
然后,在命令行執行語句:go mail,就可以直接登陸到你的gmail了。
同樣類似的命令還有:
Go notebook
/archive/2006/07/09/446673.html
Go bookmarks à網絡收躲夾
假如直接輸進go而不接任何內容的話,則會以你的名義登陸到google.com首頁。另外,googleSpecific.js最好用screnc.exe進行加密,加密后的文件格式是.jse,但即使是這樣也不能保證文件中的密碼不被別人看到(scrdec可以進行解密)。
以上就是網站制作之C#語言技術,希看能幫助大家~!