Esempio n. 1
0
        void ConnectUser()
        {
            if (!isConnected)
            {
                client           = new ServiceChatClient(new System.ServiceModel.InstanceContext(this));
                ID               = client.Connect(textBox1.Text);
                isConnected      = true;
                button1.Text     = "Отключиться";
                textBox1.Enabled = false;

                AllData [] field = client.GetData();
                for (int i = 0; i < field.Length; i++)
                {
                    listBox1.Items.Add(Convert.ToDateTime(field[i].Time).ToString("HH:mm:ss") + " " + field[i].Username + " " + field[i].Message);
                }
            }
        }