コード例 #1
0
ファイル: Program.cs プロジェクト: shaibaoj/youpp
        static void Main(string[] args)
        {
#if DEBUG
            uint   qq   = 976811781u;
            string pass = Console.ReadLine();
#else
            Console.Write("请输入QQ:");
            uint qq = uint.Parse(Console.ReadLine());
            Console.Write("请输入密码:");
            string pass = Console.ReadLine();
#endif

            client                       = new QQClient(qq, pass);
            client.User.IsUdp            = true;
            client.LoginStatusChanged   += client_LoginStatusChanged;
            client.ReceiveClusterIM     += client_ReceiveClusterIM;
            client.ReceiveNormalIM      += client_ReceiveNormalIM;
            client.AddedToCluster       += client_AddedToCluster;
            client.LoginSuccessed       += client_LoginSuccessed;
            client.CardChanged          += client_CardChanged;
            client.ClusterAdminChanged  += client_ClusterAdminChanged;
            client.AddToClusterNeedAuth += client_AddToClusterNeedAuth;
            client.AddedToClusterInvite += client_AddedToClusterInvite;
            client.Login();

            var input = Console.ReadLine();
            while (client.User.LoginStatus == Coco.Framework.Entities.LoginStatus.NeedVerifyCode)
            {
                client.SendVerifyCode(input);
                input = Console.ReadLine();
            }

            client.Logout();
        }