2

我正在写 opc 客户端。在远程服务器上创建 com 服务器的实例。首先:远程服务器上的所有设置都是正确的。我测试了 5 个 opc-example 客户端,它们运行良好。但是当我从我的代码中使用 cocreateinstance 时它失败了,访问被拒绝。我认为是因为:

COAUTHINFO coauthinfo = new COAUTHINFO();
        coauthinfo.dwAuthnSvc = 0;
        coauthinfo.dwAuthzSvc = 0;
        coauthinfo.pwszServerPrincName = IntPtr.Zero;
        coauthinfo.dwAuthnLevel = 0;
        coauthinfo.dwImpersonationLevel = 1;
        coauthinfo.pAuthIdentityData = IntPtr.Zero;
        coauthinfo.dwCapabilities = 0;

我必须在这里写哪些常量才能获得匿名访问。我的意思是仅使用 com 服务器的 guid 和远程服务器的名称来调用 dcom?

4

0 回答 0