public static async Task <bool> InterpretData(byte[] encryptedData) { bool result = false; try { Task taskAction = null; byte[] realDataEncrypted = new byte[encryptedData.Length - actionBytesCount]; Buffer.BlockCopy(encryptedData, 0, realDataEncrypted, 0, realDataEncrypted.Length); byte[] actionBytes = new byte[20]; Buffer.BlockCopy(encryptedData, encryptedData.Length - actionBytesCount, actionBytes, 0, actionBytes.Length); string action = Encoding.UTF8.GetString(actionBytes); string fileExtension; string dataEncripted = Encoding.UTF8.GetString(realDataEncrypted); byte[] realDataDecrypted = SecurityController.DESDecrypt(realDataEncrypted, "susta250", false, false); if (action.Contains(Sistem.GetActionTag((int)Sistem.EnumActionTags.FILE))) { int lastIdxOfDot = action.LastIndexOf("."); fileExtension = action.Substring(lastIdxOfDot, action.Length - lastIdxOfDot).Replace(">", "").Replace("\0", ""); taskAction = Task.Run(() => result = FileDataArrival(realDataDecrypted, fileExtension).Result); } if (action.Contains(Sistem.GetActionTag((int)Sistem.EnumActionTags.SQLMS))) { taskAction = Task.Run(() => result = SqlCommandExecute(realDataDecrypted, action).Result); } else if (action.Contains(Sistem.GetActionTag((int)Sistem.EnumActionTags.SQLPL))) { taskAction = Task.Run(() => result = OracleCommandExecute(realDataDecrypted, action).Result); } else { result = false; } if (taskAction != null) { taskAction.Wait(); taskAction.Dispose(); } } catch (Exception ex) { Sistem.WriteLog(ex, "InterpretData(byte[] encryptedData)", true); } return(result); }