c#发传真

public void SendFax(string DocumentName,
string FileName, string RecipientName, string FaxNumber)
{
if (FaxNumber != "")
{
try
{
FAXCOMLib.FaxServer faxServer = new FAXCOMLib.FaxServerClass();
faxServer.Connect(Environment.MachineName); FAXCOMLib.FaxDoc faxDoc = (FAXCOMLib.FaxDoc)faxServer.CreateDocument(FileName);
faxDoc.RecipientName = RecipientName;
faxDoc.FaxNumber = FaxNumber;
faxDoc.DisplayName = DocumentName;
int Response = faxDoc.Send();
faxServer.Disconnect();
}
catch(Exception Ex){MessageBox.Show(Ex.Message);}
}
}
为了在工程中引用faxcom 1.0 Type Library,必须首先安装Windows Component 中的Fax services。

posted on 2009-02-19 20:00  chuncn  阅读(691)  评论(0编辑  收藏  举报

导航