public static void PersonVerify() { var client = new Baidu.Aip.Face.Face(API_KEY, SECRET_KEY); client.Timeout = 60000; // 修改超时时间 var image = ComFunc.StreamToBase64String(new FileStream("C:/Users/admin/Desktop/2.jpg", FileMode.Open)); var imageType = "BASE64"; var idCardNumber = "420104198108172011"; var name = "张三"; // 调用身份验证,可能会抛出网络等异常,请使用try/catch捕获 var result = client.PersonVerify(image, imageType, idCardNumber, name); Console.WriteLine(result); // 如果有可选参数 // var options = new Dictionary<string, object>{ // {"quality_control", "NORMAL"}, // {"liveness_control", "LOW"} //}; // // 带参数调用身份验证 // result = client.PersonVerify(image, imageType, idCardNumber, name, options); // Console.WriteLine(result); }