2011-05-18 69 views
0

我使用下面的代碼發送傳真:錯誤發送傳真

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

什麼是錯誤? – Aristos 2011-05-18 12:32:49

+0

這是錯誤'檢索具有CLSID {CDA8ACB0-8CF5-4F6C-9BA2-5931D40C8CAE}的組件的COM類工廠失敗,原因如下:80040154.' – Vivekh 2011-05-18 13:00:15

+0

無法在服務器上找到傳真對象/程序,或沒有權限運行它。 – Aristos 2011-05-19 00:23:10

回答

0

我認爲問題出在您的組件註冊... 您是否使用regsvr32註冊了組件?看看here 或者,也許問題可能是64位體系結構,如果該組件部署與32位工作。 This可以幫助在這種情況下。

0

它可能與運行該服務的帳戶上某些缺失的權限有關。您可以看看Here爲您的問題的可能的解決方案

0

此問題不僅適用於64位操作系統,它也彈出在Windows XP中。 在Windows XP中這個過程解決了我的問題: 轉到控制面板 - >添加刪除程序文件 - >添加刪除Windows組件 - >檢查傳真服務複選框,如果它沒有選中,插入Windows XP CD和安裝傳真服務。重新啓動您的系統。而已。