try
{
Credential cred = new Credential
{
SecretId = "",
SecretKey = ""
};
ClientProfile clientProfile = new ClientProfile();
HttpProfile httpProfile = new HttpProfile();
httpProfile.Endpoint = ("ocr.tencentcloudapi.com");
clientProfile.HttpProfile = httpProfile;
OcrClient client = new OcrClient(cred, "ap-guangzhou", clientProfile);
IDCardOCRRequest req = new IDCardOCRRequest();
string strParams = "{\"ImageUrl\":\"D:\\\\Gitee\\\\C#\\\\Property Management System\\\\PMS\\\\PMS\\\\bin\\\\Debug\\\\PersonImguserImage.jpg\",\"CardSide\":\"FRONT\"}";
req = IDCardOCRRequest.FromJsonString<IDCardOCRRequest>(strParams);
IDCardOCRResponse resp = client.IDCardOCR(req).
ConfigureAwait(false).GetAwaiter().GetResult();
Console.WriteLine(AbstractModel.ToJsonString(resp));
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
Console.Read();
请这段代码为什么出错啊
相似问题