我的目标是检查系统是否知道/不知道坐在我的摄像头前面的人。首先,我在一个控制台应用程序中尝试了它,每个人都认为它工作得很好,但现在我想在WPF中有一个“好”的操作,我在我的WPF应用程序中实现了所有的东西,甚至是一个Anti UI Block系统,但现在我得到了一个例外

我知道这是一个很大的惊喜。很抱歉,exeption是用德语写的(我不能更改它)。内容: System.Net.Http.HttpRequestException:发送时出错,远程主机关闭了连接。
下面是触发exeption的方法:
private static async Task<List<DetectedFace>> DetectFaceRecognize(IFaceClient faceClient, string path, string recognition_model)
{
try
{
FileStream fs = File.OpenRead(path);
IList<DetectedFace> detectedFaces = await faceClient.Face.DetectWithStreamAsync(fs, detectionModel: DetectionModel.Detection03);//Exeption triggert here
Console.WriteLine($"{detectedFaces.Count} face(s) detected from image `{Path.GetFileName(path)}`");
fs.Close();
return detectedFaces.ToList();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
return await DetectFaceRecognize(faceClient, path, recognition_model);
}
}有人能帮我解决这个问题吗?
发布于 2021-07-27 13:58:16
是否可以通过添加以下行来显式设置TLS版本
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;https://stackoverflow.com/questions/68539612
复制相似问题