c# 发送传真的方法
来源:互联网 发布:union intersect sql 编辑:程序博客网 时间:2024/05/17 02:10
private void SendFax()
{
string hostName = Dns.GetHostName();
string dir =System.Configuration.ConfigurationSettings.AppSettings["FaxDocPath"].ToString();
string faxFile =@"//"+hostName+@"/"+dir+@"/"+Session["FileGuid"];
string errorMessage;
int intsend=0;
string faxID = "";
int sign;
string faxNumber = "";
for(int i=0;i<this.lstSelectCompany.Items.Count;i++)
{
faxNumber = this.lstSelectCompany.Items[i].Value;
FileInfo f = new FileInfo(faxFile);
if(f.Exists)
{
FAXCOMLib.FaxServer faxsvr = null;
FAXCOMLib.FaxDoc faxdoc = null;
try
{
faxsvr = new FAXCOMLib.FaxServer();
faxdoc = (FAXCOMLib.FaxDoc)faxsvr.CreateDocument(f.FullName);
}
catch(Exception ex)
{
errorMessage = ex.Message;
}
try
{
faxsvr.Connect(hostName); // or specify the computer name Environment.MachineName
}
catch (Exception ex )
{
errorMessage = ex.Message;
}
try
{
faxdoc.FileName =f.FullName;
faxdoc.RecipientTitle = "RecipientTitle";
faxID = f.Name; //System.DateTime.Now.ToString();/
faxdoc.RecipientAddress = "RecipientAddress";
faxdoc.RecipientCompany = "RecipientCompany";
faxdoc.RecipientCountry = "RecipientCountry";
faxdoc.RecipientDepartment = "RecipientDepartment";
faxdoc.RecipientHomePhone = "RecipientHomePhone";
faxdoc.RecipientName = faxID; /**/////////////传真id号
faxdoc.RecipientOffice = "RecipientOffice";
faxdoc.RecipientOfficePhone = "RecipientOfficePhone";
faxdoc.SenderAddress = "SenderAddress";
faxdoc.SenderCompany = "SenderCompany";
faxdoc.SenderDepartment = "SenderDepartment";
faxdoc.SenderFax = "SenderFax";
faxdoc.SenderHomePhone = "SenderHomePhone";
faxdoc.SenderOfficePhone = "SenderOfficePhone";
faxdoc.SenderTitle = "SenderTitle";
faxdoc.CoverpageName = "CoverpageName";
faxdoc.CoverpageNote = "CoverpageNote";
faxdoc.CoverpageSubject = "CoverpageSubject";
faxdoc.FaxNumber =faxNumber; // Specify the Fax Number;
intsend = faxdoc.Send();
sign = 1;
}
catch ( Exception ex )
{
errorMessage = ex.Message;
WriteAppLog(errorMessage);
throw new Exception(errorMessage);
}
}
}
}
- 发送传真的c#方法
- 发送传真的c#方法
- 发送传真的c#方法
- c# 发送传真的方法
- 发送传真的c#方法_.NET教程
- C# 发送邮件的方法
- C#发送Email的方法
- 调用JavaAPI发送传真
- JACOB发送传真
- 传真发送的318配置和启动的流程
- C# 传真服务
- 用Email免费发送传真
- 手机接受和发送传真
- 调用Java API发送传真
- [置顶] 免费在线发送传真
- C#发送E-Mail的简单方法
- C#发送Email邮件的方法解析
- C#发送Email邮件的方法解析
- asp.net新闻系统的设计与实现
- java xml的读写操作!
- 函数调用规范__cdecl和__stdcall的区别一目了然(表格形式)
- 我的EdifierR201T08
- VC语言扩展一览
- c# 发送传真的方法
- Doevents优化
- 一份适合自己的理想真难``
- java基础知识总结(3)
- 10 Places to Sell Templates
- N81手机内存清理
- Kaspersky Internet Security 2009
- 进销存设计思路
- 中医,软件工程,科学,杂谈