Example #1
0
        private void TransferManager(string logFile)
        {
            if (currentDataLoggerConfig.IsLogRemote())
            {
                TransferBase transferUtil = new FTPTransfer();

                if (currentDataLoggerConfig.IsLogToFTP())
                {
                    transferUtil = new FTPTransfer();
                }
                if (currentDataLoggerConfig.IsLogToSFTP())
                {
                    transferUtil = new SFTPTransfer();
                }

                transferUtil.Host                 = currentDataLoggerConfig.RemoteHost;
                transferUtil.Port                 = currentDataLoggerConfig.RemotePort;
                transferUtil.Username             = currentDataLoggerConfig.Username;
                transferUtil.Password             = currentDataLoggerConfig.Password;
                transferUtil.SourceDirectory      = currentDataLoggerConfig.LocalDirectory;
                transferUtil.DestinationDirectory = currentDataLoggerConfig.RemoteDirectory;

                transferUtil.UploadFile(logFile);
            }
        }