惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - Be Myself

安装Docker Toolbox后出现的问题 SharePoint 2013 必备组件之 Windows Server AppFabric 安装错误 日志记录组件 ASP.NET 中执行 URL 重写 Could not load file or assembly 'System.Data.SQLite' or one of its dependencies Visual Studio 2012 cannot identify IHttpActionResult distributed caching for .net applications HTTP Error 503. The service is unavailable windows 7 HTTP Error 500.21 - Internal Server Error resolution ! C#字符串反转 - Be Myself - 博客园 HTTP could not register URL http://+:****/WCFService/. Your process does not have access rights to this namespace CSpider 安装和配置branchcache asp.net下url参数含有中文读取后为乱码 找出数组中是否有重复的数 时间复杂度为O(n)的排序算法 IIS 7.0 HTTP 错误 404.3 - Not Found解决办法 博文阅读密码验证 - 博客园 MSMQ, WCF and IIS: Getting them to play nice (Part 3)[转]
Exchange WebSerivce Usage
Be Myself · 2014-06-23 · via 博客园 - Be Myself

//ExchangeService版本为2007SP1              

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);            

//参数是用户名,密码,域              

service.Credentials = new WebCredentials("xxx@xxx.com", "xxxxxx", "xxx");            

//给出Exchange Server的URL              

//service.Url = new Uri("mail.xxxx.com");            

//你自己的邮件地址 xxx@xxx.xxx              

service.AutodiscoverUrl("xxx@xxx.com");            

//创建过滤器, 条件为邮件未读.              

SearchFilter sf = new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false);            

//查找Inbox,加入过滤器条件,结果10条              

FindItemsResults<Item> findResults = service.FindItems(                 WellKnownFolderName.Inbox,                 sf,                 new ItemView(100));

            if (findResults.Items.Count > 0)          

   {             

    PropertySet detailedPropertySet = new PropertySet(BasePropertySet.FirstClassProperties, AppointmentSchema.Recurrence);

                service.LoadPropertiesForItems(from Item item in findResults select item, detailedPropertySet);      

       }

            foreach (Item item in findResults.Items)      

       {            

     EmailMessage email = EmailMessage.Bind(service, item.Id);

                string content = item.Body.Text;

                if (!email.IsRead)              

   {                     Console.WriteLine(email.Body);             

        //标记为已读                  

     email.IsRead = true;                  

   //将对邮件的改动提交到服务器                

       email.Update(ConflictResolutionMode.AlwaysOverwrite);    

       }      

       }