Re: delphi - WeOnlyDo Discussion board

Re: delphi (General questions)

by arno, Friday, January 04, 2008, 20:45 (6167 days ago) @ woddrazen

Hi,

I try this but i have always the same problem

wodSSHCom1.Blocking:=true;
wodSSHCom1.Connect1; // Connect is protected keyword for Delphi,
// so wrapper moved our Connect to Connect1
wodSSHCom1.WaitFor ('regex:[a-zA-z0-9]+@[a-zA-z0-9]+:[a-zA-z0-9~/]+[$ #>] $');
wodSSHCom1.DataReady := 0;
memo2.Text := wodSSHCom1.Execute('ls -al' + #10, 'regex:[a-zA-z0-9]+@[a-zA-z0-9]+:[a-zA-z0-9~/]+[$ #>] $');


Regards,
Arno

Hi Arno,


Please try something like this in Delphi:
[code]
wodSSHCom1.Connect1;

wodSSHCom1.WaitFor ('regex:[$ #>] $');
wodSSHCom1.DataReady := 0;
memo2.Text := wodSSHCom1.Execute( ls -al + vbLf, 'regex:[$ #>] $');[/code]

Before you execute command using Execute Method you should wait for a prompt to done that. That's why I use WaitFor Method in my code.

More help for WaitFor Method you can find here:
http://www.weonlydo.com/SSH/Help/WODSSHLib~wodSSH~WaitFor.html

When using Execute Method you don't need to call wodSSH Receive Method. Execute Method should return response from server. In your case in memo2.

Let us know how it goes.


Regards,
Drazen


Complete thread: