Example #1
0
 public static void Senden_double(double data)
 {
     try
     {
         byte[] bytes = BitConverter.GetBytes(data);
         server.SendPacket(bytes);
     }
     catch (Exception)
     {
         MessageBox.Show("Fehler beim senden der Daten", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void Commands(string command, TcpClient sender)
        {
            switch (command)
            {
            case "getInfos":
                server.SendPacket(sender, new Packet(new OS()));
                server.SendPacket(sender, new Packet(new Mainboard()));
                break;

            case "getCPU":
                server.SendPacket(sender, new Packet(new CPU()));
                break;

            case "getRAM":
                server.SendPacket(sender, new Packet(new RAM()));
                break;

            case "getMB":
                server.SendPacket(sender, new Packet(new Mainboard()));
                break;

            case "getDisk":
                server.SendPacket(sender, new Packet(new Disk()));
                break;
            }
        }
Example #3
0
 private void Server_PacketReceived(object sender, PacketReceivedEventArgs e)
 {
     AsyServer.SendPacket(e.Packet);
     //AsyServer.SendPacket(e.Sender, e.Packet);
 }