Esempio n. 1
0
        private void ReciveCommonFile(Message message)
        {
            string fileName = CreateCommonFileName(message.StringMessage);

            SendResult(true);
            if (_sslChannel.ReciveFile(fileName))
            {
                var fileSize = new FileInfo(fileName).Length.ToString();
                _dbController.SaveNewCommonFile(message.StringMessage, fileName, fileSize);
            }
        }
Esempio n. 2
0
 public static bool GetCommonFile(string fileId, string fileName)
 {
     lock (_sslChannel)
     {
         try
         {
             _sslChannel.SendMessage(new Message(Commands.GetCommonFile, fileId));
             var recived = _sslChannel.ReciveMessage();
             if (recived.Command != Commands.Ok)
             {
                 LastError = recived.StringMessage;
                 return(false);
             }
             _sslChannel.ReciveFile(fileName);
         }
         catch (Exception ex)
         {
             LastError = ex.Message;
             return(false);
         }
         return(true);
     }
 }