Re: Multiple PromptReceived don't seem to work - WeOnlyDo Discussion board

Re: Multiple PromptReceived don't seem to work (General questions)

by wodDrazen, Monday, October 09, 2006, 16:30 (6620 days ago) @ hactic

Hi,


If you set Blocking Property to True, than wodTelnetDLX will execute line by line. Wait to execute first command and that go to second (if your code is working good).

Other option which is better is that you use Login and Password Property instead Send Method for authentication to server.

Here is example in C#. Example will show you how to connect to some server and execute some command (ls -al in this case) with wodTelnetDLX:

-----------------------------------------
tel1 = new WODTELNETDLXCOMLIB.wodTelnetDLXCom();

tel1.Hostname = your_server_name ;
tel1.Protocol = WODTELNETDLXCOMLIB.ProtocolsEnum.Telnet;
tel1.Login = your_login ;
tel1.Password = your_password ;
tel1.Blocking = true;
tel1.Connect( your_server_name ,23,WODTELNETDLXCOMLIB.ProtocolsEnum.Telnet);

tel1.WaitFor ( regex:[$ #>] $ ,30);
textBox1.Text = textBox1.Text + (tel1.Execute ( ls -al +
, regex:[$ #>] $ ,30));
-----------------------------------------

More help for Blocking Property you can find here:
http://www.weonlydo.com/TelnetDLX/Help/WODTELNETDLXLIB~wodTelnetDLX~Blocking.html

Hope I helped.


Regards,
Drazen


Complete thread: