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

查看:31
本文介绍了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

然后使用此(作为)网址创建书签(在任何浏览器中):

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天全站免登陆