Windows 10 IoT Serials 11 – 如何设置微软认知服务中EndPoint
2023-09-11 14:17:02 时间
1.问题描述
在UWP应用开发过程中,如果要使用微软认知服务,很多开发者会使用Microsoft.Oxford.Face、Microsoft.Oxford.Vision的NuGet包来完成。如果在visual studio中调试时,弹出异常信息,如“VIsionCLient引发了异常”之类的提示。此时,就要注意认知服务的Endpoint和Key。
以很多开发者申请试用的认知服务为例:(网址为:https://westcentralus.api.cognitive.microsoft.com/vision/v1.0 ),其信息如下:
可以看到对应的终结点Endpoint和Key。
2.解决方法
在调用服务时,需要制定其Endpoint和Key。以人脸识别服务Face API为例,在新建FaceServiceClient类时,将Key和Endpoint作为参数传入,如下所示。
//Face service
FaceServiceClient f_client = new FaceServiceClient(key_face, "https://westcentralus.api.cognitive.microsoft.com/face/v1.0");
如果key和Endpoint对不上,就会引发异常。“HTTP 401 Access Denied error with a message “Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription.”
相关文章
- MongoDB本地安装与启用(windows )
- Windows服务项目打包成安装包(Windows服务)-----------VS2017项目程序打包成.msi或者.exe
- C# Windows服务开发从入门到精通
- 使用windows服务和MSMQ和进行日志管理(解决高并发问题)
- ASP服务器I I S出现authentication mode=Windows错误解决办法
- Asp.net(C#) windows 服务{用于实现计划任务,事件监控等}
- Windows 10、Windows 2012 安装 Oracle 11g 报错:[INS-13001]环境不满足最低要求。
- Windows 下使用 SNMP 来管理网络
- 转 关闭Windows8的Windows Search服务
- 使用Topshelf创建Windows服务
- 启动Windows服务
- golang程序在windows上,注册为服务
- MFC Windows 程序设计[293]之多分屏窗口(附源码)
- MFC Windows 程序设计[147]之ODBC数据库连接(附源码)
- Windows 服务卸载之后 重新安装提示 “指定的服务已标记为删除”
- 在WAS 6.1里为NodeAgent创建Windows系统服务
- Windows ICS 服务无法启动问题解决
- chromium在windows上的编译 构建 Checking out and Building Chromium for Windows
- 编译win10的WSL2内核(windows subsystem linux)
- Windows API一日一练(52)GetCurrentDirectory和SetCurrentDirectory函数
- C# 编写Windows Service(windows服务程序)
- 如何通过修改注册表关闭、开启windows10内置Windows Defender安全中心 - SYSTEMCurrentControlSetServices注册表里的服务禁用下
- LogonTracer:用于可视化分析Windows安全事件日志寻找恶意登录的工具
- 微信小程序开发在app.json中新建页面时报错[ WXML 文件编译错误] (env: Windows,mp,1.06.2208010; lib: 2.19.4)
- ABTO VoIP SIP SDK for Windows 4.21 Crack
- 【MySQL笔记】Windows采用压缩包方式安装MySQL数据库服务
- Windows下IIS搭建Ftp服务器