Exemplo n.º 1
0
        static void test2()
        {
            Console.Write("PORT:");
            int port = int.Parse(Console.ReadLine());

            Client.Client client = new Client.Client("127.0.0.1", 9840, port);
            client.Init();
            ClientUser    c  = client.UserInfo;
            NCAsyncResult aa = (NCAsyncResult)client.BeginLogin("1501", "123", ar =>
                                                                { }
                                                                , null);

            while (!aa.IsCompleted)
            {
                Console.WriteLine("等待中。。。");
            }
            Console.WriteLine(aa.BaseResult.ToString() + aa.Info);

            client.BeginLogin("0000", "123456", ar =>
            {
                var a = (NCAsyncResult)ar;
                Console.WriteLine(a.BaseResult.ToString() + a.Info);
            }
                              , null);
            Console.Read();
        }