我使用以下代码发送传真:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{ FaxDocument(@"E:\ss.doc", "04428257363");
}
} public int FaxDocument(String TheFile, string faxnumber)
{
int JobID = 0; FAXCOMEXLib.FaxServer faxsrv = new FAXCOMEXLib.FaxServerClass();
try
{ faxsrv.Connect(Environment.MachineName); FaxDocumentClass faxdoc = new FAXCOMEXLib.FaxDocumentClass();
//*** How can I add 2 or more attachments to my fax Body with the use of one coverpage?
faxdoc.Body = @"E:\ss.doc"; //******************************************************************************************
faxdoc.Priority = FAX_PRIORITY_TYPE_ENUM.fptNORMAL; faxdoc.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptLOCAL;
faxdoc.CoverPage = "TestCoverPage";
faxdoc.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstNOW;
faxdoc.DocumentName = "Fax Transmission"; faxdoc.Recipients.Add(faxnumber, "Lexicon");
faxdoc.AttachFaxToReceipt = false;
faxdoc.Note = "Here is the info you requested";
faxdoc.Subject = "Today's fax";
faxdoc.ConnectedSubmit(faxsrv);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
finally
{
faxsrv.Disconnect();
}
return JobID;
}
}
However, I get the following error:
Retrieving the COM class factory for component with CLSID {CDA8ACB0-8CF5-4F6C-9BA2-5931D40C8CAE} failed due to the following error: 80040154.
非常感谢任何帮助解决此错误。
答案 0 :(得分:0)
答案 1 :(得分:0)
它可能与运行该服务的帐户上的某些缺少权限有关。您可以查看Here以找到问题的可能解决方案
答案 2 :(得分:0)
此问题不仅适用于64位操作系统,它还会在Windows XP中弹出。 在Windows XP中,此过程解决了我的问题: 转到控制面板 - >添加删除程序文件 - >添加删除Windows组件 - >选中“传真服务”复选框(如果未选中),插入Windows XP CD并安装传真服务。重启系统。就是这样。