0
有接收信件的功能:的的IMail對象轉移到另一種形式
private void button1_Click(object sender, EventArgs e)
{
ListViewItem list = new ListViewItem("Messages");
using (imap = new Imap())
{
imap.ConnectSSL("imap.yandex.ru");
imap.Login("----", "---");
imap.SelectInbox();
List<long> uids = imap.SearchFlag(Flag.All);
IMail email;
listView1.Items.Clear();
foreach (long uid in uids)
{
ListViewItem lvi = new ListViewItem();
email = new MailBuilder().CreateFromEml(imap.GetMessageByUID(uid));
lvi.SubItems.Add(email.Subject);
listView1.Items.Add(lvi);
}
}
}
另一種形式,我試圖傳遞給IMAIL objecto oher形式:
private void button2_Click(object sender, System.EventArgs e)
{//тут надо пулучать выбранный UID
//получим выделенный элемент
int SelectedMessageIndex = listView1.FocusedItem.Index;
IMail email2 = new MailBuilder().CreateFromEml(imap.GetMessageByUID(SelectedMessageIndex));
MessageForm messageForm = new MessageForm(SelectedMessageIndex,email2); //нужно передать нужный email
messageForm.ShowDialog();
}
但我得到的錯誤:
Access to the liquidated object is not possible. Object name: "ClientBase".