自动打开浏览器,登录到一个网站? [英] Automatically open a browser and login to a site?

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

问题描述

我有没有用惯了电脑一个70岁的奶奶,但她有一个电子邮件和Facebook,而每次她想要访问这些网站我一定要帮她完成整个过程的时间。所以,我有一个想法,我知道一点编程的,所以我试图做一个批处理文件来使自动化打开火狐的过程中,键入www.exemple.com,并在她的帐户登录。有了这个,她至少可以看看是否有任何电子邮件或Facebook通知,但我可能只是做一个批量打开电子邮件网站的我想知道是否有任何方式做一个程序登录
批处理文件:

  ECHO OFF
启动FirefoxWWW.EXAMPLE.COMWWW.EXAMPLE2.COM
出口


解决方案

今天想通了这一点,我们可以如何使用Windows计算机上的批处理文件来推动,如果需要键盘命令的网站或其他应用程序。请参见原来的编码信息href=\"http://stackoverflow.com/questions/17038282/$p$pss-keyboard-keys-using-a-batch-file\">。

命令,你会发现这里的核心只是结果

  @if(@ codeSection == @Batch)@then
关闭@echoREM使用%的SendKeys%发送键键盘缓冲区
设置的SendKeys =的CScript // NOLOGO // E:JScript的%〜F0%的SendKeys%{} ENTERGOTO:EOF
@结束
// JScript的部分变种的WshShell = WScript.CreateObject(WScript.Shell);
WshShell.SendKeys(WScript.Arguments(0));

虽然我本人仍然试验和测试不同的应用这个批处理文件的程序,我不知道以什么这个方案实际执行内部运作。我只知道它使用安装在每台Windows电脑上推键盘的Java脚本要执行的命令。然而,在我的实验,我发现,它也可以作为填写密码和用户名的方式。

  @if(@ codeSection == @Batch)@then
关闭@echoREM使用%的SendKeys%发送键键盘缓冲区
设置的SendKeys =的CScript // NOLOGO // E:JScript的%〜F0
启动FirefoxWWW.EXAMPLE.COM
REM脚本仅如果有问题的应用程序是活动窗口的工作原理。设置一个计时器等待它加载!
超时/吨5
REM使用Tab键将光标移动到登录名和密码输入。大多数HTMLS很好的交互使用Tab键的存在pressed访问快​​速链接。
%的SendKeys%{TAB}
REM现在你可以把它发送实际的用户名/密码输入框
%的SendKeys%【U】
%的SendKeys%{S}
%的SendKeys%{缩放】
%的SendKeys%{R}
%的SendKeys%{N}
%的SendKeys%{A}
%的SendKeys%{m}这样
%的SendKeys%{}ê
%的SendKeys%{TAB}
%的SendKeys%{P}
%的SendKeys%{4}
%的SendKeys%{S}
%的SendKeys%{S}
%的SendKeys%【W】
%的SendKeys%{O]
%的SendKeys%{R}
%的SendKeys%{D}
%的SendKeys%{} ENTERGOTO:EOF
@结束
// JScript的部分变种的WshShell = WScript.CreateObject(WScript.Shell);
WshShell.SendKeys(WScript.Arguments(0));

因此​​,登录你的祖母到特定网站。虽然这是一个粗略的近似的code我会尝试运行,它仍然应该工作。如果没有,从我提供的链接从头开始。此外,如果你需要的方式包括那些特殊字符检查的这里为好。

*编辑:

后来我做这样的事情为自己和发现了一个更简单的方法,而不是打字了所有%的SendKeys%的。你可以简单地做

 %SendKey%用户名{TAB}
%SendKey%密码{} ENTER

由于通过在登录过程中会更简单的方法。唯一的缺点任何的是,如果她决定改变她的登录,​​您必须从程序中改变她的密码。

I have a 70 years old grandma that is not used to use the computer, but she has an e-mail and Facebook, and every time she wants to access those sites i have to help her through the process. So, i got an idea, i know a little of programing, so i tried to do a batch file to automatize this process of opening Firefox, typing "www.exemple.com", and login in her account. With this she could at least see if there are any emails or facebook notifications, but i could just do an batch to open the email site, i would like to know if there is any way to do a program to login. Batch File:

ECHO OFF
START FIREFOX "WWW.EXAMPLE.COM" "WWW.EXAMPLE2.COM"
EXIT

解决方案

Figured this out today, how one can use batch files on windows computers to push keyboard commands to websites or other applications if needed. See here for the original coding information.

The core of the command that you will find here simply results as

@if (@CodeSection == @Batch) @then


@echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"

%SendKeys% "{ENTER}"

goto :EOF


@end


// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

While i myself am still experimenting and testing this batch file program on different applications, i am not sure as to the inner-workings of what this program actually does. All i know is it uses a java script installed on every windows computer to push keyboard commands to be executed. However in my experimentation i found that it could also serve as a means to fill in passwords and usernames.

@if (@CodeSection == @Batch) @then


@echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"
START FIREFOX "WWW.EXAMPLE.COM"
rem the script only works if the application in question is the active window. Set a timer to wait for it to load!
timeout /t 5
rem use the tab key to move the cursor to the login and password inputs. Most htmls interact nicely with the tab key being pressed to access quick links.
%SendKeys% "{TAB}"
rem now you can have it send the actual username/password to input box
%SendKeys% "{U}"
%SendKeys% "{s}"
%SendKeys% "{E}"
%SendKeys% "{r}"
%SendKeys% "{N}"
%SendKeys% "{a}"
%SendKeys% "{M}"
%SendKeys% "{e}"
%SendKeys% "{TAB}"
%SendKeys% "{P}"
%SendKeys% "{4}"
%SendKeys% "{S}"
%SendKeys% "{S}"
%SendKeys% "{W}"
%SendKeys% "{O}"
%SendKeys% "{R}"
%SendKeys% "{D}"
%SendKeys% "{ENTER}"

goto :EOF


@end
// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

Thus logging your grandmother into the specific website. While this is a rough approximate of the code i would have attempted running, it should still work. If it doesn't, start from scratch with the link i provided. In addition, if you need ways to include those special characters check here as well.

*EDIT:

I later made something like this for myself and found a simpler way instead of typing out all those %SendKeys%. You can simply do

%SendKey% "Username{TAB}"
%SendKey% "Password{ENTER}"

as a more simpler way of going through the login process. The only downside to any of this is that if she decides to change her login, you would have to change her password from within the program.

这篇关于自动打开浏览器,登录到一个网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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