ZennoLab Assemblies Documentation
SendText Method (Instance)
Example 

Type: System.String

The text for typing.

Type: System.Int32

The latency between the input characters of text.

Emulates the typing.
Syntax
public void SendText( 
   string text,
   int latency
)

Parameters

text

Type: System.String

The text for typing.

latency

Type: System.Int32

The latency between the input characters of text.

Example
The following example uses the SendText method.
// clear cookie
instance.ClearCookie();
 
// navigate to lessons.zennolab.com
instance.ActiveTab.Navigate("lessons.zennolab.com", String.Empty);
 
// wait downloading
if (instance.ActiveTab.IsBusy) instance.ActiveTab.WaitDownloading();
 
// try find textarea
HtmlElement he = instance.ActiveTab.MainDocument.Body.FindChildByTag("textarea", 0);
 
// if html element is not empty
if (!he.IsVoid && !he.IsNull)
{
    // focus on this element
    he.Focus();
    // send text
    instance.SendText("It's just simple text for typing. Look at the textarea element and you can see this text.", 200);
}
// clear cookie
$instance->ClearCookie();
 
// navigate to lessons.zennolab.com
$instance->ActiveTab->Navigate("lessons.zennolab.com", "");
 
// wait downloading
if ($instance->ActiveTab->IsBusy) $instance->ActiveTab->WaitDownloading();
 
// try find textarea
$he = $instance->ActiveTab->MainDocument->Body->FindChildByTag("textarea", 0);
 
// if html element is not empty
if (!$he->IsVoid && !$he->IsNull)
{
    // focus on this element
    $he->Focus();
    // send text
    $instance->SendText("It's just simple text for typing. Look at the textarea element and you can see this text.", 200);
}
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

Instance Class
Instance Members

Send Feedback