private void ProcessSendInfo(byte[] info) { string message = DecryptStringFromBytes_Aes(info, myAes.Key, myAes.IV); JObject jObject = JObject.Parse(message); string ip = jObject["ip"].ToString(); string connection = jObject["connectionString"].ToString(); RDPClient client = new RDPClient(connection, ip); HostList.clients.Add(client); Distribute.clients.Add(client.ip); HostList.Instance().CreateControl(); if (HostList.Instance().IsHandleCreated) { HostList.AddClient(client); } if (InstallApps.Instance().IsHandleCreated) { InstallApps.AddClient(client); } if (Distribute.Instance().IsHandleCreated) { Distribute.AddClient(client); } }
public static void AddClient(RDPClient client) { if (!clients.Contains(client)) { clients.Add(client); Instance().hostsList.Invoke(new Action(() => HostList.Instance().hostsList.Items.Add(client.ip, 0))); } }