c#编写的邮件接收中
OpenPOP.MIMEParser.Attachment att = null;
OpenPOP.MIMEParser.Message msg = null;
att = (OpenPOP.MIMEParser.Attachment)msg.Attachments[1]; 
其中第三句中最后面中括号的1代表的是什么意思?为什么不是0?
我想知道为什么不是0,这个数组里面有几个元素我也不清楚  因为我在运行的时候出错了  有个索引越界了  我不确定是不是这里
请各位高手指点~~~万分感激~ 

解决方案 »

  1.   

    string   f="";   
      //string   strf="";   
      jmail.Message   Msg=new   jmail.Message();   
      jmail.POP3   jpop=new   jmail.POP3();   
      try   
      {   
      jpop.Connect("shaokang99","4226521","pop3.163.com",110);   
      Count.Text=jpop.Count.ToString();   
      Msg   =   jpop.Messages[3];   
      Sendfrom.Text   =   Msg.FromName;   
      Subject.Text   =   Msg.Subject;   
      Datetime.Text   =   Msg.Date.ToString();   
      Body.Text   =   Msg.Body;   
      num.Text=Msg.Attachments.Count.ToString();   
      for(int   i=0;i<Msg.Attachments.Count;i++)   
      {   
      f=f+Msg.Attachments[i].Name;   
      Msg.Attachments[i].SaveToFile("e:\\"+Msg.Attachments[i].Name);   
        
        
        
      }   
      name.Text=f;   
      jpop.Disconnect();   
      }   
      catch(Exception   ex)   
      {   
      Count.Text=ex.Message.ToString();   
      }  
      

  2.   

    定义一个n,int   n=1   or   2......;n是表示是第几封信,你可以用jpop.Count来循环取出所有的   
        
      Msg   =   jpop.Messages[3];--->Msg   =   jpop.Messages[n];   
        
      Msg.Attachments[i].SaveToFile("e:\\"+Msg.Attachments[i].Name);---->   
      Msg.Attachments[i].SaveToFile("e:\\"+Msg.Attachments[n].Name);