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

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

by hactic, Monday, October 09, 2006, 15:58 (6620 days ago)

Hello :-)

I'm using TelnetDLX ActiveX , and I'm wondering how I can delay the sending of the next command. I send the username, but I want it to wait with sending until the Password prompt has returned. I know that there is a way of setting the PromptReceived to a new value, but in the code that I used below , it doesn't work. Could you please tell me what I am doing wrong there.

instance of the code :

axwodTelnetDLX1.Prompt = ( login: );
axwodTelnetDLX1.PromptReceived += new EventHandler(Sendusername);
axwodTelnetDLX1.Connect(Host, null, null);

private void Sendusername(object sender, EventArgs e)
{
axwodTelnetDLX1.Send(Username +
);
axwodTelnetDLX1.Prompt = ( Password: );
axwodTelnetDLX1.Send(Password +
);
return;
}

The other problem that I have is that the ActiveX version doesn't support the Execute method as used in the COM version. Is there a way with Ax to trigger an event, after the previous event is finished. If not, then I have to apply threading to myapplication. I read something about it in the documentation, but I could figure out how it is used. Could you please give me an example ( C# ) on how to use all this.

Thanks in advance.


Complete thread: