public static void FormToExcel()
        {
            var form  = new Baidu.Aip.Ocr.Form("Api Key", "Secret Key");
            var image = File.ReadAllBytes("图片文件路径");

            form.DebugLog = false;  // 是否开启调试日志

            // 识别为Excel
            var result = form.RecognizeToExcel(image);

            Console.Write(result);
        }
Beispiel #2
0
        //调用百度识图API
        public static void FormToExcel(string picPath)
        {
            var form  = new Baidu.Aip.Ocr.Form("mQgLfOLfbgjSE7NEY0aoruWD", "8js5uXvSqPdDPrKyod1qsXcE8ISjyxDZ");
            var image = File.ReadAllBytes(picPath);

            form.DebugLog = true;  // 是否开启调试日志

            // 识别为Excel
            var result = form.RecognizeToExcel(image);

            //MessageBox.Show(result);
            Console.Write(result);
        }