使用此代码在 C# .Net 4.5 中连接到我的 IP 摄像机上的 OnVif 服务。
在该代码旁边,我正在尝试获取设备信息,如下所示:
string str = client.GetDeviceInformation(out model, out firmware, out serial, out hardwareId);
并遇到此错误:
An exception of type 'System.ServiceModel.Security.MessageSecurityException' occurred in mscorlib.dll but was not handled in user code
Additional information: The HTTP request is unauthorized with client authentication scheme 'Digest'. The authentication header received from the server was 'Basic realm="CBBA"'.
我尝试了有关 Basic realm的信息。WWW-Authenticate
通过向带有 value 的请求添加 Http 标头Basic realm="Our Site"
。但没有运气。
那是什么呀?如何解决?