Пример #1
0
        public static void get_all_sacrifice(string[] commands)
        {
            string[]    anyrec     = BaseTool._DelFirstElement(commands);
            List <Prey> _sacrifice = Prey._ConvertByteArr(anyrec);

            User._My._all_sacrifice = _sacrifice;
            Alice_client._UpdateListPrey();
        }
Пример #2
0
        public static void AddNewPrey(string Name, string token, User _my, Connection server1)
        {
            Console.WriteLine("Введите имя удаленного копьютера");
            string Name_sacrifice = Name;

            Console.WriteLine("Введите Токен");
            string Token_sacrifice = token;

            Prey._AppendPrey(Name_sacrifice, Token_sacrifice, _my, server1);     //сопоставить Prey с User
        }
Пример #3
0
        public static List <Prey> _ConvertByteArr(string[] mas)
        {
            List <Prey> _sacrifice = new List <Prey>();
            string      pl         = "";

            pl = String.Join("", mas);
            if (pl != "00False0.0.0.00")
            {
                for (int i = 0; i < mas.Length; i += 5)
                {
                    Prey _one = new Prey(mas[i], mas[i + 1], mas[i + 2], mas[i + 3], Convert.ToInt32(mas[i + 4]));
                    _sacrifice.Add(_one);
                }
                return(_sacrifice);
            }
            else
            {
                return(_sacrifice);
            }
        }
Пример #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            label3.Text = "";
            Prey.AddNewPrey(textBox1.Text, textBox2.Text, User._My, Connection.server1);


            var s = Task.Run(() => {
                while (true)
                {
                    Thread.Sleep(100);
                    if (_refresh())
                    {
                        Invoke(new Action(() => {
                            Alice_client._UpdatePrey();
                            this.Close();
                        }));
                        break;
                    }
                }
                // string test = BaseTool.Convertbtst(Connection.server1.Whait_recive());
                // Console.WriteLine(test);
            });
        }
Пример #5
0
 private void RefreshListview(User _my, Connection server1)
 {
     Prey._Get_Prey_List(Connection.server1, User._My);
     // listBox1.DataSource = _my._all_sacrifice;
 }