顶了,
1\SqlDataReader dataReader = this.ExtGetSetting(Username); 获取DataReader对象
2\Database dbase=new Database();实力话一个DB类
3\int mailID=this.GetMailID(); 邮件的ID唯一性的
1\SqlDataReader dataReader = this.ExtGetSetting(Username); 获取DataReader对象
2\Database dbase=new Database();实力话一个DB类
3\int mailID=this.GetMailID(); 邮件的ID唯一性的
解决方案 »
- xheditor 聚焦光标问题 SOS~~
- 指定播放器播放指定路径的视频,但是问题出来了
- XML文件显示在aspx页面上(在线等)
- 遍历是否选中复选框,然后进行删除。。。
- 问个关于动态数据绑定问题
- 大家来讨论一下我的这个解决Session_End事件执行效率问题
- 关于调试Web项目的问题~?
- GridView1.SelectedIndex为什么总是=-1
- Android 使用 MultipartEntity ,C# 怎么接受这个参数
- asp.net网页调试时出错,Why?(急!!在线等待)
- asp.net数据导出到Excel 2007
- 为什么在2003上连不上dbf :ERROR [IM001] [Microsoft][ODBC 驱动程序管理器] 驱动程序不支持此功能
1\SqlDataReader dataReader = this.ExtGetSetting(Username);//ExtGetSetting一个函数,返回一个SqlDataReader实例
2\Database dbase=new Database();//DataBase是一个类,估计是进行数据库操作的
3\int mailID=this.GetMailID();//一个整形,代表ID
哪给朋友给我一份可以用的接收邮件的代码吧,搞了好久没搞定,谢谢!
jmail.Message mailMessage;
jmail.Attachments atts; //建立附件集接口
jmail.Attachment att; //建立附件接口
//try
//{
popMail.Connect(EUser, EPwd, "pop.163.com", 110);
if (popMail.Count > 0)
{
for (int i = 1; i <= popMail.Count; i++)
{
UID = popMail.GetMessageUID(i);//得到服务器上每封mail的UID // 据此判断这封邮件是否是新邮件
int IfNew = objLogic.IfNewMail(UID);//在逻辑层写的一个函数判断数据库中是否有当前的UID
if (IfNew == 1)//如果不存在
{
mailMessage = popMail.Messages[i];
atts = mailMessage.Attachments;
mailMessage.Charset = "GB18030";
mailMessage.ISOEncodeHeaders = false;
From = mailMessage.From;
dtime = mailMessage.Date;
FromName = mailMessage.FromName;
Subject = mailMessage.Subject;
Body = mailMessage.Body;
#region 邮件大小的单位转换
string mSize = mailMessage.Size.ToString();
double imSize = Convert.ToDouble(mSize);
imSize *= 0.001;
string Size = Convert.ToString(imSize)+"KB";
#endregion // 邮件大小的单位转换
if (atts.Count == 0)
{
AppPath = "";
}
else
{
for (int j = 0; j < atts.Count; j++)
{
att = atts[j];
string attname = att.Name;
AppPath = "e:\\attFile\\" + attname;
try
{
att.SaveToFile("e:\\attFile\\" + attname);
}
catch(Exception ex)
{
File.Delete("e:\\attFile\\" + attname);
att.SaveToFile("e:\\attFile\\" + attname);
}
}
}
att = null;
atts = null;
objLogic.InsertInBox(UID,Subject, Body, From, dtime, Size, AppPath, FromName);
}
}
}
//else
//{
// Label1.Text = "没有新邮件!";
//}
//popMail.DeleteMessages();
popMail.Disconnect();
popMail = null;
//}
//catch
//{
// Label1.Text = "请检测网络配置!";
//}
DataTable dt = new DataTable();
dt = objLogic.SelectFromInbox();
GridView1.DataSource = dt;
GridView1.DataBind();
}