当前位置:编程学习 > C#/ASP.NET >>

c# pop 邮件删除问题

OpenPop.Pop3.Exceptions.PopServerException: The server did not respond with a + response. The response was: "-ERR already deleted (eyou mta)" 在 OpenPop.Pop3.Pop3Client.IsOkResponse(String response) 在 OpenPop.Pop3.Pop3Client.SendCommand(String command) 在 OpenPop.Pop3.Pop3Client.DeleteMessage(Int32 messageNumber)

foreach (SelectedRow row in sm.SelectedRows)
{
    int index = row.RowIndex;
    client.DeleteMessage(index + 1);
} c# server --------------------编程问答-------------------- //集合删除要从后往前删,你从前往后删会改变集合的索引位置,所以会出错
for(int i= sm.SelectedRows.Count-1;i>=0;i--) {
     SelectedRow row = sm.SelectedRows[i];
     int index = row.RowIndex;
     client.DeleteMessage(index + 1);
 }  --------------------编程问答--------------------
引用 1 楼 gxingmin 的回复:
//集合删除要从后往前删,你从前往后删会改变集合的索引位置,所以会出错
for(int i= sm.SelectedRows.Count-1;i>=0;i--) {
     SelectedRow row = sm.SelectedRows[i];
     int index = row.RowIndex;
     client.DeleteMessage(……

--------------------编程问答-------------------- 那具体要怎样写这个方法呢? 
<SelectionModel>
    <ext:CheckboxSelectionModel ID="check" runat="server" />
</SelectionModel>
我是用Checkbox的,选中的就删除 --------------------编程问答--------------------
引用 3 楼 mu_xue 的回复:
那具体要怎样写这个方法呢? 
<SelectionModel>
    <ext:CheckboxSelectionModel ID="check" runat="server" />
</SelectionModel>
我是用Checkbox的,选中的就删除

晕,上面不是给出代码了吗,参看红色部分和红色部分下一行代码 --------------------编程问答-------------------- 我用你的方法,还是不行 --------------------编程问答-------------------- OpenPop.Pop3.Exceptions.PopServerException: The server did not respond with a + response. The response was: "-ERR already deleted (eyou mta)" 在 OpenPop.Pop3.Pop3Client.IsOkResponse(String response) 在 OpenPop.Pop3.Pop3Client.SendCommand(String command) 在 OpenPop.Pop3.Pop3Client.DeleteMessage(Int32 messageNumber) --------------------编程问答-------------------- 我是先保存,然后就删除,才会出这个错误的,其他的情况都不会出这个问题 --------------------编程问答-------------------- ERR already deleted (eyou mta)"....
这个错误是说邮件已经删除了... --------------------编程问答-------------------- 说明你重复删同一个邮件了,你再看看是不是Index用的不对 --------------------编程问答-------------------- 应该不是,我只是先把邮件保存到数据库里,然后再将它从服务器上删除,这样才会报错,其他情况像直接删除是不会出错的 --------------------编程问答-------------------- for(.....)
{
   pop3.delete(0)
} --------------------编程问答-------------------- ????有代码吗? --------------------编程问答-------------------- 高手,神人。。。。 --------------------编程问答-------------------- 我知道了,是没有清理之前选保存时留下的记录
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,