private async void _checkButton_Click ( object sender, EventArgs e ) { using (IrbisConnection client = GetConnection()) { _browser.Navigate("about:blank"); try { string expression = string.Format ( "\"IN={0}\" + \"INS={0}\"", _numberBox.Text.Trim() ); int[] records = await client.SearchAsync ( expression ); if (records.Length == 0) { _browser.DocumentText = "НЕ НАЙДЕНО"; return; } if (records.Length != 1) { _browser.DocumentText = "НАЙДЕНО МНОГО"; return; } string html = await client.FormatRecordAsync ( "@", records[0] ); _browser.DocumentText = html; } catch (Exception ex) { _browser.DocumentText = ex.ToString(); } } }