c# - 使用 RightFax 在 C# 中获取 'System.AccessViolationException' 异常

标签 c# .net fax rightfax captaris

我正在尝试通过 RightFax COM API 库发送传真:

  RFCOMAPILib.FaxServer server = new RFCOMAPILib.FaxServer();
  server.ServerName = "xxx";
  server.Protocol = CommunicationProtocolType.cpTCPIP;
  server.UseNTAuthentication = BoolType.True;

  // Error happens here
  server.OpenServer(); 

  RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax)server.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax);

  fax.ToName = "Batman";
  fax.ToFaxNumber = "23434484";
  fax.FromFaxNumber = "78678676";
  fax.FromName = "Robin";
  fax.Send();

我已经注册了 DLL 文件 rfcomapi.dll:

C:\Program Files\RightFAX> RegSvr32 rfcomapi.dll     

不幸的是,在运行这段代码时,出现了以下错误;

Unhandled Exception: system.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

我使用的是 RightFax 9.4.0.0 版。

我该如何解决这个问题?

最佳答案

您的代码本身是完美的。我可以毫无问题地使用我的 9.4 RightFax 运行它。您可能需要检查您的授权以确保您的帐户在服务器中获得完全授权。

关于c# - 使用 RightFax 在 C# 中获取 'System.AccessViolationException' 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4467620/

相关文章:

c# - DateTime 转换为 Unix Epoch 添加 Phantom Hour

c# - 命名、声明和定义委托(delegate)和事件约定

c#授予Windows用户 "Log On As Service"权限

c# - 使用通过 DI 容器注入(inject)的抽象工厂

linux - Asterisk ReceiveFax 函数调用后如何做一些任务?

windows - 使用 windows 传真服务器 2008 传真 PDF

c# - 在 C# 中终止进程时,我如何确定我正在终止正确的进程?

c# - 无法解析 ASP.NET Core 2.0 中的 DbContext

javascript - 具有相同验证组的 asp.net requiredFieldValidators 不会同时触发

html - 是否存在类似 <a href ="fax:number">number</a> 的内容?