private static void ObtainNewMails() { Pop3Client client = new Pop3Client(user, password, POP3Host); try { client.OpenInbox(); } catch (Pop3LoginException) { errUserOrPassword = true; return; } int num = 0; for (int i = 1; i <= client.MessageCount; i++) { string mailUidl = client.GetMailUidl(i); if (!mails.Contains(mailUidl)) { num++; mails.Add(mailUidl); } } client.CloseConnection(); if (num > 0) { SystemHintHelper.Show(string.Format("你共收到新的消息:{0}条", num)); } lastRequestTime = new DateTime?(DateTime.Now); }