コード例 #1
0
        /// <summary>
        /// main()
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            string robot_acc    = "";
            string robot_passwd = "";

            if (args.Length == 0)
            {
                Console.WriteLine("USAGE:MSNRobot.exe <msn_account> [password]");
                return;
            }

            robot_acc = args[0];

            if (args.Length == 2)
            {
                robot_passwd = args[1];
            }
            else
            {
                Console.WriteLine("Password for " + robot_acc + ":");
                robot_passwd = Console.ReadLine();
            }

            RobotMain app = new RobotMain();

            app.BeginLogin(robot_acc, robot_passwd);

            while (true)
            {
                Console.WriteLine("I am a MSN robot:" + robot_acc);
                Console.ReadLine();
            }
        }
コード例 #2
0
 public RobotConversation(Conversation conv, RobotMain robotmain)
 {
     Console.WriteLine("==> Struct a conversation");
     _conversation = conv;
     _conversation.Switchboard.TextMessageReceived += new EventHandler <TextMessageEventArgs>(Switchboard_TextMessageReceived);
     _conversation.Switchboard.SessionClosed       += new EventHandler <EventArgs>(Switchboard_SessionClosed);
     _conversation.Switchboard.ContactLeft         += new EventHandler <ContactEventArgs>(Switchboard_ContactLeft);
     _robotmain = robotmain;
 }