public static async Task ReadFileUrl (ComputerVisionclient client, string urlFile) { const int numberofCharsInOperationId $=36$; var txtHeaders = await client.ReadAsync(urlFile, language: "en"); string opLocation = textHeaders.OperationLocation; string operationId = opLocation.Substring (opLocation. Length - numberofCharsinOperationId) ; ReadoperationResult results; results = await client.GetReadResultAsync(Guid.Parse (operationId)); var textUrlFileResults = results.AnalyzeResult.ReadResults; foreach (ReadResult page in textUrlFileResults) { foreach (Line line in page.Lines) { Console.WriteLine (line.Text) ; } } }
do { results = await client.GetReadResultAsync(Guid.Parse(operationId)); } while ((results.Status == OperationStatusCodes.Running || results.Status == OperationStatusCodes.NotStarted));