I finally figured out a combination of things that allow the Microsoft Fax Service COM Type Library to work in ASP.NET.  I just kept trying different things, and finally got it.  If you're having this problem, try the following:

我终于弄清楚了允许Microsoft传真服务COM类型库在ASP.NET中工作的各种组合。 我只是不断尝试不同的东西,终于明白了。 如果遇到此问题,请尝试以下操作:

Be sure you have a PDF viewer installed on the computer, for all PDF, FDF types.  You can use FoxIT reader, which is free, or Adobe Acrobat, which is also free.   I personally got it working with Foxit.

确保您在计算机上安装了适用于所有PDF,FDF类型的PDF查看器。 您可以使用免费的FoxIT阅读器,也可以使用免费的Adobe Acrobat。 我个人与Foxit合作。

You need the Interop library as a reference in your program.  Go to "Add a Reference" to your program, choose the "COM" tab, then look for the following: "Microsoft Fax Service Extended COM Type Library".  It is listed under M for Microsoft, not under F for faxing.  The other library under F is WRONG--do not use this.

您需要Interop库作为程序中的参考。 转到“向程序添加引用”,选择“ COM”选项卡,然后查找以下内容:“ Microsoft传真服务扩展COM类型库”。 对于Microsoft,它列在M下,对于传真,列在F下。 F下的另一个库是WRONG-请勿使用此库。

Be sure to log on as an administrator account.  We use a domain where I work, and the Domain Admin did NOT work.  The local administrator account seemed to be the only thing I could get to work, no matter what permissions I changed on the fax printer, the directories in question, etc.

确保以管理员帐户登录。 我们使用的是我工作的域,而Domain Admin 无法工作。 无论我在传真打印机,相关目录等上更改了什么权限,本地管理员帐户似乎都是我唯一可以使用的工作。

I declared by fax server once, as a part of the class.  See below:

我曾经在传真服务器中声明过一次,作为该课程的一部分。 见下文:

    public class NightlyInvoiceCreditFaxWorkerProgram{private FAXCOMEXLib.FaxServer _faxServer = new FaxServerClass();public FAXCOMEXLib.FaxServer faxSrv{get{ return _faxServer; }set{ _faxServer = value; }} 

Then I used code like this, to access:

然后,我使用如下代码访问:

       NightlyInvoiceCreditFaxWorkerProgram nws = new NightlyInvoiceCreditFaxWorkerProgram();try{nws.faxSrv = new FaxServerClass(); nws.faxSrv.Connect(""); 

Because I wrote this into a Windows service, I wrote many events to the Windows event log to see where I was hanging up.  This is a big part of the programming, so you know what's going on.

因为我将此内容写入Windows服务,所以我将许多事件写入Windows事件日志中以查看挂断的位置。 这是编程的重要组成部分,因此您知道发生了什么。

Then I used this code to listen for events:

然后,我使用以下代码侦听事件:

                nws.faxSrv.ListenToServerEvents(FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE); nws.faxSrv.OnOutgoingJobAdded += new FAXCOMEXLib.IFaxServerNotify_OnOutgoingJobAddedEventHandler(faxSrv_OnOutgoingJobAdded);nws.faxSrv.OnOutgoingJobChanged += new FAXCOMEXLib.IFaxServerNotify_OnOutgoingJobChangedEventHandler(faxSrv_OnOutgoingJobChanged);nws.faxSrv.OnOutgoingJobRemoved += new FAXCOMEXLib.IFaxServerNotify_OnOutgoingJobRemovedEventHandler(faxSrv_OnOutgoingJobRemoved); 

I used the code below for each item I needed to fax, since I send many items at once as a part of a nightly faxing routine:

我将下面的代码用于需要传真的每个项目,因为在夜间传真例程中,我一次发送了许多项目:

        try {FaxDocument faxDoc = new FaxDocumentClass();faxDoc.Priority = FAX_PRIORITY_TYPE_ENUM.fptHIGH;faxDoc.ReceiptType = FAX_RECEIPT_TYPE_ENUM.frtNONE; //THIS CODE IS TO MAKE SURE THE FILE IS NOT IN USE WHEN WE TRY TO ATTACH AND THEN SENDReadFile:FileStream fs = null;try{fs = File.OpenRead(attachmentPath); }catch (IOException){InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "Waiting for file to clear", EventLogEntryType.Information, 3);goto ReadFile;}finally{InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "File finally clear", EventLogEntryType.Information, 3);if (fs != null){fs.Close();fs.Dispose();fs = null;}} faxDoc.Body = attachmentPath;faxDoc.Subject = thisItem.InvoiceNumber; faxDoc.DocumentName = thisItem.RecipientName + " - Invoice: " + thisItem.InvoiceNumber; faxDoc.Recipients.Add(thisItem.FaxNumber, thisItem.RecipientName); object garb = faxDoc.Submit(faxSrv.ServerName); InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "Successful Fax Send!!", EventLogEntryType.Information, 10); returnString = "Send Success for Item ID: " + thisItem.ID.ToString() + " for: " + thisItem.RecipientName + "  " + thisItem.InvoiceNumber + " "; faxDoc = null;}catch (System.Runtime.InteropServices.COMException ce){ InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "Error connecting to fax server.  Error Message: " + ce.Message + " " + ce.StackTrace, EventLogEntryType.Information, 5);}

And, finally the event handlers for the fax server:

并且,最后是传真服务器的事件处理程序:

        private static void faxSrv_OnOutgoingJobRemoved(FAXCOMEXLib.FaxServer pFaxServer, string bstrJobId){InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "Job Removed to outbound queue.", EventLogEntryType.Information, 4);} private static void faxSrv_OnOutgoingJobChanged(FAXCOMEXLib.FaxServer pFaxServer, string bstrJobId, FAXCOMEXLib.FaxJobStatus pJobStatus){InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "There was a fax changed to the outgoing queue.  WAITING UNTIL FINISHED SENDING", EventLogEntryType.Information, 4); while (pJobStatus.Status != FAXCOMEXLib.FAX_JOB_STATUS_ENUM.fjsCOMPLETED){//loop until this job is completed, then go back to the program}} private static void faxSrv_OnOutgoingJobAdded(FAXCOMEXLib.FaxServer pFaxServer, string bstrJobId){InvoiceCreditFaxServiceExVersion.WriteEventToWindowsLog("InvoiceCreditFaxAndEmailServiceExVersion", "There was a fax added to the outgoing queue.", EventLogEntryType.Information, 4);}

The class I used was:

我使用的课程是:

using FAXCOMEXLib;

This seems to work perfectly--it queues up the items into the Windows Fax Viewer, which then takes care of all the rest of the stuff.  If you have any specific questions about this process feel free to let me know.  I'm glad I was able to figure it out (finally), as the documentation online is terrible for this type of thing.

这似乎工作得很完美-将项目排入Windows传真查看器,然后由它处理所有其余的工作。 如果您对此过程有任何具体疑问,请随时告诉我。 我很高兴能够(最终)弄清楚这一点,因为在线文档对于此类事情很糟糕。

Compatibility is only verified in Windows XP--I didn't try with Vista or 7.

仅在Windows XP中验证了兼容性-我没有尝试过Vista或7。

翻译自: https://www.experts-exchange.com/articles/2683/Using-FAXCOMEXLib-to-send-a-fax-in-Net-2005-version-2-0-with-a-Windows-XP-computer.html

使用FAXCOMEXLib与Windows XP计算机在.Net 2005 2.0版中发送传真相关推荐

  1. xp计算机退出家庭组,如何将Windows XP计算机加入Windows 7/8/10家庭组

    一旦你安装使用Windows 10年7月8日家庭组网络上,下一步就是要微调它使所有的较旧的计算机可以找到彼此.仅使用密码,所有Windows 7和更高版本的计算机都可以轻松加入家庭组,但是,如果您的网 ...

  2. 在Windows XP系统安装SQL server 2000 企业版(图解版)

    在Windows XP系统安装SQL server 2000 企业版(图解版) 投稿:mdxy-dxy 字体:[增加 减小] 类型:转载 今天在网上下载一个软件,需要使用MS SQL,海波用的是 Wi ...

  3. Windows XP系统安装SQL Server 2005(开发版)图解

    转自Windows XP系统安装SQL Server 2005(开发版)图解 安装前提:由于有些从网上的下载的项目需要导入SQL Server 2005的数据文件,因此,今天便安装了这个数据库,我的系 ...

  4. 如何将windows xp系统下的outlook express6.0的邮件,帐号及通迅录导入Office Outlook xp/2003/2007中

    如何将windows xp系统下的outlook express6.0的邮件,帐号及通迅录导入Office Outlook xp/2003/2007中 1.此帮助以Outlook express6.0 ...

  5. 关于Windows XP sp2下金山词霸2005取词BUG,桌面重启修正方法

    新买的电脑新装Windows XP sp2,问题不断,竟连金山词霸2005都出问题,以前用的好好的,现在发现启动金山词霸后,桌面不断地重启,重装金山词霸N次未果.一室友同一安装盘的Windows XP ...

  6. 北斗云计算机怎么样,北斗定位2.0版服务平台来了

    北斗定位2.0版服务平台来了1.2米精度.秒级定位 2020-10-15 16:44:13 34点赞 16收藏 32评论 中国的北斗三号系统已经全面建成,有了全球导航定位的能力.中国信通院14日也发布 ...

  7. Windows XP 搭建PPPoE服务器_计算机软件及应用_IT/计算机_专业资料

    Windows XP 搭建 PPPoE 服务器&使用为了测试路由器中的 pppoe 客户端(linux 环境),特意在 XP 下建立一个 pppoe 服务器. 现将详细步骤写出来:一.获取软件 ...

  8. 操作系统源代码_国产操作系统“之光”?Windows XP绝密源代码泄露,BT种子已在网上疯传...

    微软的Windows操作系统是目前使用人数最多.覆盖最广的桌面操作系统,从安全角度来看,其系统源代码对于公众而言可以说是绝密.不过......现在......,黑客在4Chan平台上以BT种子文件的形 ...

  9. windows XP全公略

    windows XP全公略 Windows XP 本文所涉各软件下载. Windows XP 13个原版文件, 可以将目前市场上几乎所有的 V3,或V4破解版恢复为 XP 原安装版 15M Windo ...

最新文章

  1. react 从使用 看定义
  2. 【数据安全案例】北京破获贩卖个人信息案 涉及上千万条公民信息
  3. ABAP:SUBMIT执行其他报表并返回的数据
  4. 程序员常用网址,必须收藏
  5. PMCAFF微分享 | 供应链金融套利套汇介绍
  6. SringBoot项目使用maven打包,使用docker部署,并且使用thymeleaf作为模板引擎遇到的问题
  7. mysql反模式_MongoDB报表实例 -- 标签成员方案
  8. uml和模式应用 pdf_「企业架构」架构知识库应用简介
  9. oreo另一个意思_记一次有意思的统计(部分大宗商品价格指数相关性统计)
  10. OpenCV中基本数据结构(8)_Complex
  11. 读《现代软件工程--构建之法》所思
  12. [技術]如何合併 GridView 中的多個標題
  13. 使用mysql导入数据
  14. 我的CSDN博客之旅
  15. 机器人走正方形c语言代码,张西臣---机器人走正方形
  16. 咸鱼之王小游戏PC版鼠标模拟器实现
  17. Python分组百分比排名
  18. html简繁体转换,在线繁体字转换工具
  19. 明光杂感之四:足球与情境觉知(上)
  20. 笹山希 java,C#版数据结构与算法高级教程(深入探讨)--附各种算法实例-升级版

热门文章

  1. spring boot和spring cloud版本冲突解决方案
  2. 【云原生-白皮书】简章1:为什么我们需要云原生架构?
  3. 解决Mac录屏生成的mov无法播放问题
  4. RM67162调试案例
  5. 6张图让你搞懂浏览器渲染网页过程
  6. 计算机毕业设计JAVACar易达租车系统mybatis+源码+调试部署+系统+数据库+lw
  7. 计算深度学习模型的推理时间、fps
  8. Google Earth Engine(GEE)——计算NDVI\EVI\RVI\DVI\SAVI计算并下载(2)
  9. Norton Furbisher v1.02 Wave4(诺顿2009系列一键90天永久试用
  10. CTA-敏感行为-发送短信