ZennoLab Assemblies Documentation
WaitCaptchaRecognition Method (ZennoPoster)
Example 

Type: System.String

The id of async revognition task.

Wait the reconition task with specified id.
Syntax
public static string WaitCaptchaRecognition( 
   string id
)

Parameters

id

Type: System.String

The id of async revognition task.

Return Value

Type: System.String

The recognition result.

Example
The following code example demonstrates uses of the CaptchaRecognition method.
public static int Execute(Instance instance)
{
    instance.ClearCookie();
 
    Tab tb = instance.MainTab;
    if ((tb.IsVoid) || (tb.IsNull)) return -1;
    if (tb.IsBusy) tb.WaitDownloading();
    tb.Navigate("http://lessons.zennolab.com/ru/advanced");
    if (tb.IsBusy) tb.WaitDownloading();
 
    HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("img", "fulltag", "img", "text", 0);
 
    string id = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "", true);
 
    // some more action
    string res = ZennoPoster.WaitCaptchaRecognition(id);
    he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
    he.SetValue(res, "Middle", false);
            
    return 0;
}
public static function Execute($instance)
{
    $instance->ClearCookie();
 
    $tb = $instance->MainTab;
    if (($tb->IsVoid) || ($tb->IsNull)) return -1;
    if ($tb->IsBusy) $tb->WaitDownloading();
    $tb->Navigate("http://lessons.zennolab.com/ru/advanced");
    if ($tb->IsBusy) $tb->WaitDownloading();
 
    $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("img", "fulltag", "img", "text", 0);
 
    $id = ZennoPoster::CaptchaRecognition("MonkeyEnter.dll", $he->DrawToBitmap(true), "", true);
 
    // some more action
    $res = ZennoPoster::WaitCaptchaRecognition($id);
    $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("recaptcha_response_field");
    $he->SetValue($res, "Middle", false);
            
    return 0;
}
Requirements

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

See Also

Reference

ZennoPoster Class
ZennoPoster Members
CaptchaSpecialRecognition Method

Send Feedback