Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to invoke web service
#59
C# interface code

The C# SDK is now open source!   https://github.com/Baidu-AIP/dotnet-sdk

This project is a basic OCR API test app as Visual Studio C# project. 

https://github.com/A9T9/Baidu-OCR-API
 
Code:
Copy      Help
 
public void GeneralBasicDemo() {
    var image = File.ReadAllBytes("Image file path");
    // Calling universal text recognition, the image parameters are local images, and may throw an exception such as the network. Please use try/catch to capture
    var result = client.GeneralBasic(image);
    Console.WriteLine(result);
    // If there are optional parameters
    var options = new Dictionary<string, object>{
        {"language_type", "CHN_ENG"},
        {"detect_direction", "true"},
        {"detect_language", "true"},
        {"probability", "true"}
    };
    // Calling general text recognition with parameters, picture parameters are local images
    result = client.GeneralBasic(image, options);
    Console.WriteLine(result);
}
public void GeneralBasicUrlDemo() {
    var url = "https//www.x.com/sample.jpg";

    // Calling universal text recognition, the image parameter is a remote url image, and may throw an exception such as the network. Please use try/catch to capture
    var result = client.GeneralBasicUrl(url);
    Console.WriteLine(result);
    // If there are optional parameters
    var options = new Dictionary<string, object>{
        {"language_type", "CHN_ENG"},
        {"detect_direction", "true"},
        {"detect_language", "true"},
        {"probability", "true"}
    };
    // Calling general text recognition with parameters, image parameters are remote url images
    result = client.GeneralBasicUrl(url, options);
    Console.WriteLine(result);
}




Messages In This Thread
How to invoke web service - by win - 04-30-2019, 06:41 AM
RE: How to invoke web service - by win - 04-30-2019, 11:27 PM
RE: How to invoke web service - by win - 05-01-2019, 04:34 AM
RE: How to invoke web service - by redbull2k - 05-01-2019, 04:43 PM
RE: How to invoke web service - by win - 05-01-2019, 11:38 PM
RE: How to invoke web service - by win - 05-02-2019, 01:45 AM
RE: How to invoke web service - by Kevin - 05-02-2019, 02:30 AM
RE: How to invoke web service - by win - 05-02-2019, 02:34 AM
RE: How to invoke web service - by Kevin - 05-02-2019, 02:55 AM
RE: How to invoke web service - by win - 05-02-2019, 03:07 AM
RE: How to invoke web service - by Kevin - 05-02-2019, 03:08 AM
RE: How to invoke web service - by win - 05-02-2019, 03:11 AM
RE: How to invoke web service - by Kevin - 05-02-2019, 03:55 AM
RE: How to invoke web service - by win - 05-02-2019, 04:04 AM
RE: How to invoke web service - by Kevin - 05-02-2019, 04:16 AM
RE: How to invoke web service - by win - 05-02-2019, 05:24 AM
RE: How to invoke web service - by Kevin - 05-02-2019, 05:42 AM
RE: How to invoke web service - by win - 05-02-2019, 06:50 AM
RE: How to invoke web service - by win - 05-02-2019, 11:20 AM
RE: How to invoke web service - by win - 05-03-2019, 03:47 AM
RE: How to invoke web service - by redbull2k - 05-03-2019, 02:21 PM
RE: How to invoke web service - by redbull2k - 05-03-2019, 03:26 PM
RE: How to invoke web service - by win - 05-03-2019, 10:10 PM
RE: How to invoke web service - by Kevin - 05-04-2019, 01:27 AM
RE: How to invoke web service - by win - 05-04-2019, 01:57 AM
RE: How to invoke web service - by Kevin - 05-04-2019, 02:32 AM
RE: How to invoke web service - by win - 05-04-2019, 02:56 AM
RE: How to invoke web service - by Kevin - 05-04-2019, 03:04 AM
RE: How to invoke web service - by win - 05-04-2019, 03:13 AM
RE: How to invoke web service - by Kevin - 05-04-2019, 03:17 AM
RE: How to invoke web service - by win - 05-04-2019, 03:27 AM
RE: How to invoke web service - by Kevin - 05-04-2019, 03:33 AM
RE: How to invoke web service - by win - 05-04-2019, 03:40 AM
RE: How to invoke web service - by Kevin - 05-04-2019, 04:19 AM
RE: How to invoke web service - by win - 05-04-2019, 04:29 AM
RE: How to invoke web service - by Kevin - 05-04-2019, 04:36 AM
RE: How to invoke web service - by redbull2k - 05-04-2019, 10:14 PM
RE: How to invoke web service - by win - 05-04-2019, 11:05 PM
RE: How to invoke web service - by redbull2k - 05-04-2019, 11:50 PM
RE: How to invoke web service - by win - 05-05-2019, 02:25 AM
RE: How to invoke web service - by win - 05-05-2019, 07:39 AM
RE: How to invoke web service - by win - 05-05-2019, 10:51 AM
RE: How to invoke web service - by redbull2k - 05-05-2019, 01:02 PM
RE: How to invoke web service - by win - 05-05-2019, 01:18 PM
RE: How to invoke web service - by redbull2k - 05-05-2019, 01:22 PM
RE: How to invoke web service - by win - 05-05-2019, 01:24 PM
RE: How to invoke web service - by redbull2k - 05-05-2019, 02:01 PM
RE: How to invoke web service - by win - 05-05-2019, 03:15 PM
RE: How to invoke web service - by Kevin - 05-05-2019, 08:36 PM
RE: How to invoke web service - by win - 05-05-2019, 09:15 PM
RE: How to invoke web service - by Kevin - 05-05-2019, 09:39 PM
RE: How to invoke web service - by win - 05-05-2019, 11:54 PM
RE: How to invoke web service - by win - 05-06-2019, 01:22 AM
RE: How to invoke web service - by Kevin - 05-06-2019, 02:19 AM
RE: How to invoke web service - by win - 05-06-2019, 02:33 AM
RE: How to invoke web service - by Kevin - 05-06-2019, 02:44 AM
RE: How to invoke web service - by win - 05-06-2019, 02:50 AM
RE: How to invoke web service - by Kevin - 05-06-2019, 03:03 AM
RE: How to invoke web service - by win - 05-06-2019, 03:11 AM
RE: How to invoke web service - by win - 05-06-2019, 02:05 PM
RE: How to invoke web service - by win - 05-06-2019, 10:00 PM
RE: How to invoke web service - by win - 05-06-2019, 11:03 PM
RE: How to invoke web service - by redbull2k - 05-06-2019, 11:31 PM
RE: How to invoke web service - by Kevin - 05-06-2019, 11:40 PM
RE: How to invoke web service - by redbull2k - 05-06-2019, 11:44 PM
RE: How to invoke web service - by win - 05-07-2019, 12:07 AM
RE: How to invoke web service - by Kevin - 05-07-2019, 12:31 AM
RE: How to invoke web service - by redbull2k - 05-07-2019, 12:33 AM
RE: How to invoke web service - by win - 05-07-2019, 12:36 AM
RE: How to invoke web service - by Kevin - 05-07-2019, 01:06 AM
RE: How to invoke web service - by win - 05-07-2019, 01:11 AM
RE: How to invoke web service - by Kevin - 05-07-2019, 02:42 AM
RE: How to invoke web service - by win - 05-07-2019, 03:00 AM
RE: How to invoke web service - by win - 05-07-2019, 01:31 PM
RE: How to invoke web service - by win - 05-07-2019, 11:52 PM
RE: How to invoke web service - by redbull2k - 05-08-2019, 12:45 AM
RE: How to invoke web service - by win - 05-08-2019, 12:49 AM
RE: How to invoke web service - by redbull2k - 05-08-2019, 12:55 AM
RE: How to invoke web service - by win - 05-08-2019, 01:01 AM
RE: How to invoke web service - by redbull2k - 05-08-2019, 01:30 AM
RE: How to invoke web service - by win - 05-08-2019, 01:42 AM
RE: How to invoke web service - by redbull2k - 05-08-2019, 01:56 AM
RE: How to invoke web service - by win - 05-08-2019, 02:10 AM
RE: How to invoke web service - by win - 05-09-2019, 01:40 AM

Forum Jump:


Users browsing this thread: 20 Guest(s)