| Author |  | 
      
        | simone Guest Group
 
  
 
 Joined: 10 November 2003
 Online Status: Online
 Posts: 262
 | 
          Hello,
           | Posted: 21 August 2005 at 10:55pm | IP Logged |   |  
           | 
 |  
 Can you please provide an example of using the search method to retrieve the UID's in C#.NET? In particular the casting of the system.object[] back to its original type (presumably a long?)
 
 Regards
 Simone
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Unlike IMAP UIDs, POP3 UIDs are strings. So, to iterate through POP3 UIDs, you can use the code like the following:
           | Posted: 22 August 2005 at 11:14am | IP Logged |   |  
           | 
 |  
 
| Code: 
 
    
    | 
      
       | MailBee.POP3Class pop3 = new MailBee.POP3Class();
 pop3.LicenseKey = "your trial or permanent key";
 pop3.Connect("pop.server.com", 110, "user", "pass");
 Array uids = (Array)pop3.Search();
 foreach (object uid in uids)
 {
 Console.WriteLine((string)uid);
 }
 pop3.Disconnect();
 pop3 = null;
 
 |  |  |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Simone Guest Group
 
  
 
 Joined: 10 November 2003
 Online Status: Online
 Posts: 262
 | 
          Hi Alex,
           | Posted: 22 August 2005 at 7:35pm | IP Logged |   |  
           | 
 |  
 Thanks, it works just fine using the above code.
 
 Regards,
 Simone
 | 
       
        | Back to Top |     | 
       
       
        |  |