Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Message.Process()上的ImapX IndexOutoforAngeException_C#_Wpf_Xaml_Indexing_Mailing - Fatal编程技术网

C# Message.Process()上的ImapX IndexOutoforAngeException

C# Message.Process()上的ImapX IndexOutoforAngeException,c#,wpf,xaml,indexing,mailing,C#,Wpf,Xaml,Indexing,Mailing,我刚刚开始使用你的ImapX库检索和阅读gmail邮件。 现在,一切正常,这是一个很棒的图书馆 但是,当我尝试使用Message.Process()选项标记邮件读取时,它返回IndexOutOfRangeException private void Start() { int amountRead = 0; failedMessages.Clear(); foreach(string origin Properties.Settings.

我刚刚开始使用你的ImapX库检索和阅读gmail邮件。 现在,一切正常,这是一个很棒的图书馆

但是,当我尝试使用Message.Process()选项标记邮件读取时,它返回IndexOutOfRangeException

private void Start()
    {
        int amountRead = 0;
        failedMessages.Clear();

        foreach(string origin Properties.Settings.Default.MailOrigins)
        {
            IMailOriginAdapter adapter = MailOriginFactory.CreateMailOriginContainer(origin);

            foreach (ImapX.Message message in adapter.Messages())
            {
                if (SendWebRequest(url))
                {
                    message.Process();
                    amountRead++;

                    Dispatcher.BeginInvoke(new MethodInvoker(delegate
                    {
                        this.btnStart.Content = "Read [" + amountRead + "/" + GmailUser.Instance.Messages.Count + "]";
                    }));
                }
                else
                {
                    failedMessages.Add(message);
                }
            }

            System.Windows.MessageBox.Show(adapter.GmailFromEmail() + " reading completed.");
        }
    }
希望有人能帮我解决这个问题,我已经有一个多月的时间了

提前谢谢

你诚挚的,
Larssy1

当您单步执行代码时。。哪一行抛出错误..?它在message.Process()的行上;larssy1您是否可以或您是否可以获得此行的消息计数
adapter.Messages()