//step 1 log in, after the success of the login into the menu options
S:='plink - SSH - pw 111111 [email protected];//the default port 22 SSH
Memo1. Lines. The Clear;
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
Doscommand1.Com mandLine:=s;
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 2 select menu press 1
Memo1. Lines. The Clear;
S:='1';
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 3 enter the IP, according to the IP query equipment
Memo1. Lines. The Clear;
S:='/I: 10.10.15.26';
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//choose to login equipment according to the step 4 1
Memo1. Lines. The Clear;
S:='1';
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 5 command options, press 1, automatically enter the Telnet (port 23)
Memo1. Lines. The Clear;
S:='1';
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 5 command options, press 1, automatically enter the Telnet (port 23)
Memo1. Lines. The Clear;
S:='1';
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 6 input Telnet user name
Memo1. Lines. The Clear;
S:='WWW'.
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 7 type Telnet password
Memo1. Lines. The Clear;
S:='123456'.
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
//step 8 input Telnet command
Memo1. Lines. The Clear;
S:='show MAC;
Memo1. Lines. The Add (' current command + s + 'return results');
Memo1. Lines. The Add (");
DosCommand1. SendLine (s, true);
Doscommand1. OutputLines:=Memo1. Lines;
DosCommand1. Execute;
CodePudding user response:
Step 5: when you copy and paste to repeat the above codeCodePudding user response:
Can't change ideas adopted the focus of hidden window open window to simulate keyboard input wayWinexec (' the putty - load 123 - pw 111111 [email protected], sw_hide);
H:=findwindow (nil, '123');
S:='1';
For I:=1 to length (s) do the begin
The SetForegroundWindow (h);
SwitchToThisWindow (h, true);
[I] MyKeyPress (s);
end;
Keybd_event,0,0,0 (13);
KEYEVENTF_KEYUP keybd_event (13, 0, 0).
A good way to please inform thank you