【问题标题】:Access denied attempting to watch completed events访问被拒绝尝试观看已完成的事件
【发布时间】:2012-03-30 23:53:25
【问题描述】:

我们目前正在使用带有 rfcomlib API 的 RightFax v9.3.2.89。目前,我们只是在每个人的计算机上安装了 RightFax,因为生成这些传真的应用程序在桌面上。由于我们正在转向 Web 解决方案,我们将只在服务器上安装 RightFax。问题是用户将无法查看传真是否成功发送。查看 API,我发现我可以执行以下操作:

faxServer.Events.WatchCompleteEvents = BoolType.True;
faxServer.OnCompleteEvent += faxServer_OnCompleteEvent;

问题是,当我订阅观看已完成的事件时,我得到了

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

浏览网页我可以看到这个错误可能来自一百万个来源。这很奇怪,因为我对我的计算机拥有管理权限。

有什么想法吗?

很遗憾,RightFax 网站毫无用处,而且几乎没有资源可用。

【问题讨论】:

  • 这看起来像是 DCOM 配置错误。我的主要建议是每 5-10 秒轮询一次状态,而不是订阅事件,因为它在面对狡猾的网络时会更加强大。
  • 哇。这so容易多了。我可以简单地获取其句柄发送的传真,看看StatusDescription 是什么。如果您发表评论作为答案,我将很乐意接受。谢谢。

标签: c# com access-denied rightfax


【解决方案1】:

我注意到当使用 Ben 的上述方法时,状态描述永远不会更新。即使在 FaxUtil 中传真已明确发送且状态为“OK”,以下示例将永远休眠并显示“Waiting for Conversion”状态。

fax.Send();

while (fax.StatusDescription != "OK")
{
    Console.WriteLine("Polling fax handle " + fax.Handle.ToString() 
                   + " for status. Found: " + fax.StatusDescription);
    Thread.Sleep(5000);
}

我认为 RightFax API 没有文档并且难以使用。我希望这对原始海报有所帮助。

【讨论】:

    【解决方案2】:

    对fax.StatusDescription 的轮询会使程序陷入无限循环。您需要做的是反复轮询有问题的传真对象。以下示例抓取特定文件夹中的所有传真对象,识别您需要的一个传真对象并查询该对象的 StatusDescription。

    string status = "";
    string description = "";
    int handle = fax.Handle; // this identifies the fax object you're polling for
    while (status != "fsDoneOK") // keep polling fax object until status is "OK"
    {    
        foreach (Fax obj_fax in obj_user.Folders["Main"].Faxes) // look in the "Main" folder for fax objects
        {
            if (handle == obj_fax.Handle) // check to see if this object is yours
            {
                status = obj_fax.FaxStatus.ToString();
                description = obj_fax.StatusDescription;
                System.Diagnostics.Debug.WriteLine("Fax Status: " + obj_fax.StatusDescription);
            }
            if (status == "fsDoneError" || status == "fsError") // check for fax error
                break;
        }
        if (status == "fsDoneError" || status == "fsError") // check for fax error
            break;  
        Thread.Sleep(3000); // sleep for 3 seconds and then poll again
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-10
      • 1970-01-01
      • 2016-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-25
      • 2016-03-09
      相关资源
      最近更新 更多