Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:百度云fa piao识别

1楼
wanglin3033 发表于:2024/8/16 9:07:00
代码实例:https://ai.baidu.com/ai-doc/OCR/nk3h7xy2t

Dim fpsb_url As String = "https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice?access_token={0}"

Dim data() As Byte = System.IO.File.ReadAllBytes("c:\2.png") '把文件字节流加载进来,
Dim d As String = Convert.ToBase64String(data)
Dim hc As New HttpClient(CExp(fpsb_url, AccessToken))
hc.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
hc.C
Dim zjo As New JObject
Dim dt As String = """image=" & d & """"
hc.Content = dt '提交数据并发起OA流程'
zjo = JObject.Parse(hc.GetData()) '获取流程发起ID
Output.Show(zjo.ToString)

提示图片格式错误
图片点击可在新窗口打开查看此主题相关图片如下:提交代码.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2024/8/16 9:30:44编辑过]
2楼
wanglin3033 发表于:2024/8/16 9:34:00
使用APIpost 可以成功
图片点击可在新窗口打开查看此主题相关图片如下:apipost.png
图片点击可在新窗口打开查看
3楼
wanglin3033 发表于:2024/8/16 9:35:00

图片点击可在新窗口打开查看此主题相关图片如下:apipost1.png
图片点击可在新窗口打开查看
4楼
有点蓝 发表于:2024/8/16 9:53:00
Dim fpsb_url As String = "https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice?access_token={0}"
Dim data() As Byte = System.IO.File.ReadAllBytes("c:\2.png") '把文件字节流加载进来,
Dim d As String = Convert.ToBase64String(data)
Dim hc As New HttpClient(CExp(fpsb_url, AccessToken))
hc.ContentType = "application/x-www-form-urlencoded"
hc.FormData.Add("image",UrlEncode(d))
Dim zjo As JObject = JObject.Parse(hc.GetData()) '获取流程发起ID
[此贴子已经被作者于2024/8/16 9:53:27编辑过]
5楼
wanglin3033 发表于:2024/8/16 9:57:00
Dim fpsb_url As String = "https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice?access_token={0}"

Dim data() As Byte = System.IO.File.ReadAllBytes("c:\2.png") '把文件字节流加载进来,
Dim d As String = Convert.ToBase64String(data)
Dim hc As New HttpClient(CExp(fpsb_url, AccessToken))
hc.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
hc.FormData.Add("image", d)
Dim zjo As New JObject
zjo = JObject.Parse(hc.GetData()) '获取接口返回数据
Output.Show(zjo.ToString)
  感谢 有点蓝的指点,最终代码是个,可以正常返回数据;不能对d 进行转码
[此贴子已经被作者于2024/8/16 10:03:44编辑过]
共5 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.