Windows机器上的网站自动登录脚本? [英] Automatic login script for a website on windows machine?

查看:1942
本文介绍了Windows机器上的网站自动登录脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有人有文件(我猜是批处理文件)。在单击批处理文件时,他能够登录到多个站点。 (也许是使用VB完成的。)

I saw some guy had a file (I guess a batch file). On clicking of the batch file he was able to log in to multiple sites. (Perhaps it was done using VB.)

我在Google上找了这样一个脚本,但没有找到任何有用的东西。

I looked for such a script on Google but didn't find anything useful.

我知道一些C ++和UNIX(也有一些HTML和JavaScript)。我不知道是否可以在使用这些语言的Windows机器上完成,但即使可以完成,我认为与VB或C ##或其他一些高级语言相比也很难。

I know a bit of C++ and UNIX (also some HTML and JavaScript). I don't know if it can be done on a windows machine using these languages, but even if it could be done I think it would be difficult compared to VB or C## or some other high level languages.

我学会了如何使用批处理文件中包含的基本Windows批处理命令打开多个站点,如:

I learned how to open multiple sites using basic windows batch commands enclosed in a batch file like:

start http://www.gmail.com
start http://stackoverflow.com

但我仍然无法弄清楚实际点击批处理文件是如何帮助我在没有输入用户名和密码的情况下登录网站的。

But still I can't figure out how actually clicking on the batch file would help me to log in to the sites without even typing the username and password.

我是否需要开始学习Visual Basic,.NET或Windows批处理编程才能做到这一点?

Do I need to start learning Visual Basic, .NET, or windows batch programming to do this?

还有一件事:我还能用它来登录远程桌面吗? ?

One more thing: can I also use it to log in to remote desktops?

推荐答案

从自动登录一词来看,我认为安全性(密码保护)在这里并不重要。

From the term "automatic login" I suppose security (password protection) is not of key importance here.

可以使用解决方案的指南一个JavaScript书签(从 M& M的DK网站上发布的好游戏借来的想法)。

The guidelines for solution could be to use a JavaScript bookmark (idea borrowed form a nice game published on M&M's DK site).

我们的想法是创建一个javascript文件并将其存储在本地。它应该根据当前站点地址输入登录数据。只是一个使用jQuery的例子:

The idea is to create a javascript file and store it locally. It should do the login data entering depending on current site address. Just an example using jQuery:

// dont forget to include jQuery code
// preferably with .noConflict() in order not to break the site scripts
if (window.location.indexOf("mail.google.com") > -1) {
    // Lets login to Gmail
    jQuery("#Email").val("youremail@gmail.com");
    jQuery("#Passwd").val("superSecretPassowrd");
    jQuery("#gaia_loginform").submit();
}

现在保存为 login.js

然后用这个(作为)url创建一个书签(在任何浏览器中):

Then create a bookmark (in any browser) with this (as an) url:

javascript:document.write("<script type='text/javascript' src='file:///path/to/login.js'></script>");

现在,当您转到Gmail并单击此书签时,您的脚本将自动登录。

Now when you go to Gmail and click this bookmark you will get automatically logged in by your script.

将脚本中的代码块相乘,以类似的方式添加更多站点。您甚至可以将它与 window.open(...)功能组合以打开更多站点,但这可能会使脚本包含更复杂。

Multiply the code blocks in your script, to add more sites in the similar manner. You could even combine it with window.open(...) functionality to open more sites, but that may get the script inclusion more complicated.

注意:这只说明了一个想法,需要进一步的工作,这不是一个完整的解决方案。

Note: This only illustrates an idea and needs lots of further work, it's not a complete solution.

这篇关于Windows机器上的网站自动登录脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆