Example #1
0
 private void GetFullData()
 {
     Command command = new Command(Command.Commands.FullData, string.Empty);
     JsonProtocol protocol = new JsonProtocol();
     protocol.SendObject(command, tcpClient);
     Command comresp = null;
     while (comresp == null)
     {
         comresp = protocol.ReadObject(tcpClient, typeof(Command)) as Command;
     }
     protocol.SendObject(new Command(Command.Commands.Exit, string.Empty), tcpClient);
     result = MakeMeTable(comresp);
 }
Example #2
0
        private void GetImage(int id)
        {
            Command command = new Command(Command.Commands.ReadPhoto, id.ToString());
            JsonProtocol protocol = new JsonProtocol();
            protocol.SendObject(command, tcpClient);

            Command respCom = null;
            while (respCom == null)
            {
                respCom = protocol.ReadObject(tcpClient, typeof(Command)) as Command;
            }
            string fileName = "tmp.jpg";
            SaveFile(respCom.File, fileName);
            result = string.Format(@"<img src=""{0}"">", result);
        }