| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 586 人关注过本帖
标题:[各位大侠]谁有解析邮件的代码
只看楼主 加入收藏
zfl313
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2007-8-13
收藏
 问题点数:0 回复次数:0 
[各位大侠]谁有解析邮件的代码
我自己写的代码解析不出正确的邮件内容我知道怎么解析一下是我的代码.
 while (sr.Peek ()>0)
           {
               string str = sr.ReadLine();
               if(str.IndexOf ("Subjiect:")>=0)
               {
                   int start = str.IndexOf(":");
                   mail.Title = str.Substring(start+1).Trim();
               }
               else if (str.IndexOf("To") >= 0)
               {
                   int start = str.IndexOf(":");
                   mail.SendMail = str.Substring(start + 1).Trim();
               }
               else if (str.IndexOf("Cc") >= 0)
               {
                   int start = str.IndexOf(":");
                   mail.CC = str.Substring(start + 1).Trim();
               }
               else if (str.IndexOf("Date") >= 0)
               {
                   int start = str.IndexOf(":");
                   mail.DataTime = str.Substring(start + 1).Trim();
               }
               else if (str.IndexOf("From") >= 0)
               {
                   int start = str.IndexOf(":");
                   mail.ReceiveMail = str.Substring(start + 1).Trim();
               }
               else if (str.IndexOf("Message-Id:") >= 0)
               {
                   continue;
               }
               else
               {
                   mail.Body += str + "\r\n";
               }
           }
搜索更多相关主题的帖子: 邮件 代码 解析 
2008-04-15 17:54
快速回复:[各位大侠]谁有解析邮件的代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013559 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved