开发者

Show amount of unread emails in C#

开发者 https://www.devze.com 2023-01-12 06:53 出处:网络
I want to show how many unread emails I have in my inbox (g开发者_JAVA百科mail) and show this number in a label.

I want to show how many unread emails I have in my inbox (g开发者_JAVA百科mail) and show this number in a label.

e.g Inbox(3)

I've tried a load of sites but couldn't get anything.

I'm new to programming in general so any help would be great.


The simplest is to do a query to: http://mail.google.com/mail/feed/atom/unread/

You can read more about it here: http://googlesystem.blogspot.com/2008/03/feed-for-unread-gmail-messages.html

As pointed out by @TheVillageIdiot, there is a the code gallery at http://code.msdn.microsoft.com/CSharpGmail . Scroll down and read about GmailAtomFeed.


Hope this page on code gallery will help you.


You need to do something like below.

1- Maintain a column (Say IsReaded) in the database table if you are using some database table to store your email.

1- When ever user clicks an email , you need to update the column in database table to 'Y'.

you can do this task asynchronously, using Ajax

2- Just use this Sql ' select count(1) from tblMessages where IsRead ='N''

3- than update the label with the count.

0

精彩评论

暂无评论...
验证码 换一张
取 消