All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
C#技巧:网页表单自动填写技术(gmail为例)_[Asp.Net教程]

Writer: delv Article type: Programming skills(编程技巧) Time: 2014/1/8 7:02:43 Browse times: 376 Comment times: 0

C#技巧:网页表单自动填写技术(gmail为例)_[Asp.Net教程]


Head photo

Go homepage
Upload pictures
Write articles

C#技巧:网页表单自动填写技术(gmail为例)_[Asp.Net教程]

var ie=WScript.createobject("InternetExplorer.Application");
var args = WScript.arguments;
var followme="http://www.google.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;

//等待IE操作结束。
function SynchronizeIE()
{
while(ie.Busy)
{
WScript.Sleep(100);
}
}
假定把该文件保存为googleSpecific.js,存放在%windir%\system32路径下,并建立如下内容的一个google.bat文件同样放在%windir%\system32路径下。

@cls

@wscript %windir%\system32\googleSpecific.js %1 %2 %3 %4 %5 %6 %7 %8 %9

然后,在命令行执行语句:go mail,就可以直接登陆到你的gmail了。

同样类似的命令还有:

Go notebook à便签簿

http://flappy.cnblogs.com/archive/2006/07/09/446673.html

Go bookmarks à网络收藏夹

如果直接输入go而不接任何内容的话,则会以你的名义登陆到google.com首页。另外,googleSpecific.js最好用screnc.exe进行加密,加密后的文件格式是.jse,但即使是这样也不能保证文件中的密码不被别人看到(scrdec可以进行解密)。更好的保密手段还请各位多提意见。

来源:网络





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.