windows 通过 .NET/C# 发送传真
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3663338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sending Fax through .NET/C#
提问by Prabhu
How do I go about sending fax in .NET? We have a fax server through which we need to fax documents to clients. Since we have a fax server, I don't imagine that I have to configure a fax modem on my machine, right? It would just go through the fax server?
如何在 .NET 中发送传真?我们有一个传真服务器,我们需要通过它向客户传真文件。既然我们有传真服务器,我不认为我必须在我的机器上配置传真调制解调器,对吗?它只会通过传真服务器?
Are there any good free (or cheap) Fax APIs out there? IN my research I've come across FAXCOMEXLib, FaxMan, and Windows Fax Service, but the documentation seems limited, so I am hoping someone here can point me in the right direction.
有没有好的免费(或便宜的)传真 API 吗?在我的研究中,我遇到了 FAXCOMEXLib、FaxMan 和 Windows 传真服务,但文档似乎有限,所以我希望这里有人能指出我正确的方向。
Thanks!
谢谢!
采纳答案by Jerry Coffin
As far as I know, .NET doesn't have anything built in to directly support sending faxes via a fax server. Absent that, you'd probably want to use the COM interface to the fax server. Basically, you create a FaxServer object and invoke its Connect method to connect to the fax server. You then invoke the FaxServer's CreateDoc method to create a fax document object. The FaxDoc object has a (huge) number of properties to specify more about the recipient and document than any sane person would imagine, but the two main ones are the FileName and FaxNumber. Once you've set those (along with any others you want) you invoke its Send method to send that document to that fax number.
据我所知,.NET 没有内置任何内容来直接支持通过传真服务器发送传真。如果没有,您可能想使用传真服务器的 COM 接口。基本上,您创建一个 FaxServer 对象并调用其 Connect 方法以连接到传真服务器。然后调用 FaxServer 的 CreateDoc 方法来创建传真文档对象。FaxDoc 对象具有(大量)属性来指定有关收件人和文档的更多信息,超出了任何正常人的想象,但两个主要的属性是 FileName 和 FaxNumber。一旦您设置了这些(以及您想要的任何其他设置),您就可以调用其 Send 方法将该文档发送到该传真号码。
I last played with this a few years ago, so I'm probably skipping a few things. Mostly I remember that it seemed strange that the FaxServer created a blank FaxDoc that you filled in and then asked to send itself, and that there was a lotof documentation covering "stuff" that initially seemed like it would be necessary, but turned out to be completely irrelevant, at least for what I was doing (and in retrospect, probably usually would be).
我上次玩这个是几年前,所以我可能会跳过一些东西。大多数情况下,我记得 FaxServer 创建了一个空白的 FaxDoc,你填写了它然后要求自己发送,这似乎很奇怪,而且有很多文档涵盖了最初似乎是必要的“东西”,但结果证明完全无关紧要,至少对于我正在做的事情(回想起来,可能通常是这样)。
回答by Steve Rukuts
Depending on your budget, you may consider a fax to e-mail service instead. Many services have a .NET-compatible API, and reasonable rates.
根据您的预算,您可以考虑使用传真转电子邮件服务。许多服务都有一个与 .NET 兼容的 API 和合理的费率。
This is likely to be considerably easier (and therefore, cheaper) than actually interacting with a fax server.
这可能比实际与传真服务器交互要容易得多(因此也更便宜)。
回答by atik sarker
If you do not want to use any 3rd party API like interfax, then you have to use Faxman or FAXCOMEXLib. But from this year www.data-tech.comis not responding which provide faxman or faxman jr SDK for sending fax. faxman jr product is not working on windows 10. although they are announce that it will work on windows 10 PC, but it is not working.
如果您不想使用任何第三方 API,如 interfax,那么您必须使用 Faxman 或 FAXCOMEXLib。但是从今年开始www.data-tech.com没有响应提供 faxman 或 faxman jr SDK 发送传真。faxman jr 产品不能在 Windows 10 上运行。虽然他们宣布它可以在 Windows 10 PC 上运行,但它不起作用。
http://www.data-tech.com/blog/post/FaxMan-SDK-Version-5-Upgrade-Available.aspx
http://www.data-tech.com/blog/post/FaxMan-SDK-Version-5-Upgrade-Available.aspx
I am not sure but may be data-tech just stop their service, because last time I email them multiple time but they are not responding anything. So you can use faxcomlib and this is a very simple to send fax.
我不确定,但可能是数据技术人员停止了他们的服务,因为上次我给他们发了多次电子邮件,但他们没有任何回应。所以你可以使用faxcomlib,这是一个非常简单的发送传真。
Please check link for a sample using FAXCOMEXLib.
请检查链接以获取使用 FAXCOMEXLib 的示例。
https://code.msdn.microsoft.com/C-Send-Fax-using-fax-Modem-357aca81/
https://code.msdn.microsoft.com/C-Send-Fax-using-fax-Modem-357aca81/