自动登录linux服务器,自动输入用户名和密码

#include <windows.h>
#include <stdio.h>

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
HWND ParenthWnd;
HWND ButtonHWnd;

HWND EditHwnd;

ShellExecute(NULL,"open","D:\\Program Files\\teraterm\\ttermpro.exe",NULL,NULL,SW_SHOWNORMAL);

Sleep(1000);

ParenthWnd = FindWindow(NULL,TEXT("Tera Term: New connection"));
if(NULL == ParenthWnd)
{
MessageBox(NULL,TEXT("Cant't find term"),NULL,MB_OK);
}


ButtonHWnd = FindWindowEx(ParenthWnd,NULL,"Button","OK"); 
if(NULL == ButtonHWnd)
{
MessageBox(NULL,TEXT("Cant't find button"),NULL,MB_OK);
}


SendMessage(ButtonHWnd, BM_CLICK , 0, 0);


Sleep(1000);


ParenthWnd = FindWindow(NULL,TEXT("SSH Authentication"));
if(NULL == ParenthWnd)
{
MessageBox(NULL,TEXT("Cant't find SSH"),NULL,MB_OK);
}

EditHwnd = FindWindowEx(ParenthWnd,NULL,"Edit",""); 
if(NULL == EditHwnd)
{
MessageBox(NULL,TEXT("Cant't find Edit"),NULL,MB_OK);
}


SendMessage(EditHwnd, WM_SETTEXT , 0, (LPARAM)"abc");


EditHwnd = FindWindowEx(ParenthWnd,EditHwnd,"Edit",""); 
if(NULL == EditHwnd)
{
MessageBox(NULL,TEXT("Cant't find Edit"),NULL,MB_OK);
}


SendMessage(EditHwnd, WM_SETTEXT , 0, (LPARAM)"123");


ButtonHWnd = FindWindowEx(ParenthWnd,NULL,"Button","OK"); 
if(NULL == ButtonHWnd)
{
MessageBox(NULL,TEXT("Cant't find button"),NULL,MB_OK);
}


SendMessage(ButtonHWnd, BM_CLICK , 0, 0);
return 0;
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Changes in Tera Term version 4.93 Added 48x48 icon to keycode.exe. Bug Fixes in Tera Term version 4.93 After Kanji(receive) is set to EUC and UTF-8 string is displayed, new Kanji(Chinese character) may be properly shown when Kanji(receive) is set to UTF-8. When Kanji(receive) is set to UTF-8, ISO-2022-JP Kanji cannot be properly displayed with Japanese language setting. When DeferredLogWriteMode=on is enabled and a log file is closed soon after opening the file, Tera Term sometimes halts with dead-lock. When Log dialog is closed, the memory leak of Tera Term core(ttermpro.exe) was happening. Windows 7 and Vista: When special operation is done on General setup dialog, an application fault may occur. When the real time mode is off while using broadcast command, invalid character would be added to the end of string. MACRO: When closesbox command is executed, the memory leak of Macro core(ttpmacro.exe) was happening. MACRO: The gethostname, gettitle, getmodemstatus, loginfo and logopen commands in rear cases would have issues. Related Product Upgrades Upgraded TTSSH to 2.79. Upgraded CygTerm+ to 1.07_29. Upgraded TTProxy to 1.0.0.24. Upgraded TeraTerm Menu to 1.14. Upgraded TTX KanjiMenu Plug-in to 0.1.7. Upgraded TTXRecurringCommand Plug-in to 1.05. Upgraded Oniguruma to 6.1.2. Changes in TTSSH version 2.79 When an Order(CipherOrder, KexOrder, HostKeyOrder, MacOrder, CompOrder) is read from the teraterm.ini file, memory corruption could occur. Tera Term(TTSSH) may hang up while a file is being received via SCP. Upgraded OpenSSL to 1.0.2j. Changes in Cygterm+ 1.07_29 Changed the icon image. Changes in TTProxy version 1.0.0.24 When an authentication is used in HTTP proxy, Tera Term(TTProxy) would crash. When an authentication is used on HTTP proxy, the authentication data would not be encoded with base64 protocol. The HTTP proxy connection was changed from HTTP/1.0 to HTTP/1.1. Changes in TeraTerm Menu version 1.14 Updated the TeraTerm icon (teraterm.ico). Changes
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值