home *** CD-ROM | disk | FTP | other *** search
- // This is the main project file for VC++ application project
- // generated using an Application Wizard.
-
- #include "stdafx.h"
- #using <mscorlib.dll>
- #using <system.dll>
-
- using namespace System;
-
- #include "Pop3Client.h"
-
- // This is the entry point for this application
-
- int main(int argc, char *argv[ ])
- {
- Console::WriteLine();
-
- // Check parameters.
- if(argc != 4)
- {
- Console::WriteLine (String::Format ("Usage: {0} servername username password", new String(argv[0])));
- Console::Write ("Press Enter to continue");
- Console::ReadLine();
- return 0;
- }
-
- // Create POP3Client object.
- CPOP3Client* POP3 = new CPOP3Client();
-
- // Set properties from command line.
- POP3->ServerName = new String(argv[1]);
- POP3->UserName = new String(argv[2]);
- POP3->Password = new String(argv[3]);
-
- // Get number of messages in the mailbox.
- int count = POP3->NumberOfMessages;
-
- // If -1 returned, error occurred, then print error message.
- if (count < 0) Console::WriteLine (String::Concat ("Error: ", POP3->Status));
- else Console::WriteLine (String::Format ("You have {0} messages in your mailbox", __box (count)));
-
- Console::Write ("Press Enter to continue");
- Console::ReadLine();
- return 0;
- }