我正在尝试通过 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/