Results 1 to 2 of 2

Thread: [Resolved] What is wrong? Worked under VS 2003 but not in VS 2005

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    Köln
    Posts
    395

    Resolved [Resolved] What is wrong? Worked under VS 2003 but not in VS 2005

    Hi, I get on the line
    int count = int.Parse(listHeader[1]);
    the following error. "Input string was not in a correct format."


    Under Visual Studio 2003 I had no problem with it. Now I am using Visual Studio 2005 and Error. Why?

    thanks in advance

    VB Code:
    1. /// <summary>
    2. /// Get all mails form the pop3 server.
    3. /// </summary>
    4. /// <param name="body">
    5. /// If set it returns mailheader and message.
    6. /// </param>
    7. /// <returns></returns>
    8. public MailHeader[] GetMails(bool body)
    9. {
    10.      string list = GetList();
    11.      if(list==null || list.Length==0 || !list.StartsWith("+OK"))
    12.           return null;
    13.  
    14.      string[] param = list.Split('\n');
    15.      string[] listHeader = param[0].Split(' ');
    16.  
    17.      int count = int.Parse(listHeader[1]);
    18.  
    19.      MailHeader[] myHeader = new MailHeader[count];
    20.      for (int n=0;n<count;n++)
    21.      {
    22.           string[] msg = param[n+1].Split(' ');
    23.  
    24.           myHeader[n] = GetMail(int.Parse(msg[0]),body);
    25.      }
    26.      return myHeader;
    27. }







    Added green "resolved" checkmark - Hack
    Last edited by Hack; Jan 4th, 2006 at 08:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width