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 @ 2007-12-20 15:42  玉开  阅读(2584)  评论(11编辑  收藏  举报