listBox1.Items.Add的行(從+「:」+ x.Subject);是什麼,是不是返回所需的結果,它增加了「:」而不是「名姓:主題標題」ImapX不給我電子郵件主題/消息信息:
https://imapx.codeplex.com/wikipage?title=Sample%20code%20for%20get%20messages%20from%20your%20inbox
List<Task> m = new List<Task>();
private async void cmdLogin_Click(object sender, EventArgs e)
{
bool result = imapMail.Connection();
if (result)
{
result = imapMail.LogIn(email, password);
if (result)
{
var messes = imapMail.Folders[inbox].Messages;
foreach (var x in messes)
{
string from = "";
foreach (var addresses in x.From)
{
from = addresses.DisplayName;
}
listBox1.Items.Add(from + ": " + x.Subject);
}
foreach (ImapX.Message msgs in imapMail.Folders[inbox].Messages)
{
m.Add(new Task(new Action(() => msgs.Process())));
}
await Task.WhenAll(m);
}
else { this.Text = "failed login"; }
}
else { this.Text = "Failed connection"; }
}
}
這不是除了冒號返回任何東西,它應該返回一個顯示名稱:消息主題
可能重複(http://stackoverflow.com/questions/15462004/cannot-implicitly-convert-type-int-to -tasksint) – 2013-03-18 18:33:56
請不要發佈相同的問題,因爲你沒有得到迴應。答覆將以重複方式結束。 – 2013-03-18 18:34:19
我編輯了你的標題。請參閱:「[應該在其標題中包含」標籤「](http://meta.stackexchange.com/questions/19190/)」,其中的共識是「不,他們不應該」。另外,與論壇網站不同,我們不使用「謝謝」或「任何幫助表示讚賞」,或者在[so]上簽名。請參閱「[應該'嗨','謝謝',標語和致敬從帖子中刪除?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be ()從目錄中刪除) – 2013-03-18 18:39:42