在C# winform中,我想把c:\a.exe这个文件作为附件发送到 [email protected],怎么实现?谢谢
解决方案 »
- 在32位win7下用vs2010开发的软件,到xp下可以直接运行吗
- 三层架构之数据库的增删改的问题
- 再次求助个时间问题,知道的朋友麻烦指点指点
- 关于查找,请高手指点!
- GridView,DetailsView,DropDownList1
- 简单问题请教:sqlserver查询
- <b><font color="red">海南的朋友告诉我.NET程序员的收入?<b>
- WEBFORM中如何实现WINFORM里的ME.CURSOR=CURSORS.WAITCURSOR
- 怎么让导到Winform里的WORD不被编辑,要求通过Word.ApplicationClass实现,非常感谢
- 谁有C#2002光盘 七张的?
- Remoting客户端激活对象的问题,请高手帮忙?
- 在C# 里面通过 Microsoft Excel 对象库 调用EXCEL 部署时必须在安装机器安装 excel 2003 吗 急等
把附件路径添好。。或者提前把路径写道list中public void AddAttachments(ArrayList attachmentsList)
{
string filePath = string.Empty; foreach (object file in attachmentsList)
{
try
{
filePath = (string)file;
if( File.Exists(filePath) == false)
{
MessageBox.Show("附件文件不存在或已经被移除,请检查。");
}
else
{//file existed
MailAttachment MyAttachment = new MailAttachment(filePath);
msg.Attachments.Add(MyAttachment);
}
}
catch(Exception ex)
{
MessageBox.Show("附件文件路径格式错误,请检查。");
}
}
}