Example #1
0
        public FTPTransporter()
        {
            InitializeComponent();

            Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            try
            {
                this.Settings = SettingsContainer.GetSettings();
            }
            catch (Exception ex)
            {
                EventLog.Source = "FtpTransporter";
                EventLog.WriteEntry(string.Format("{0}: {1}. {2}", ex.StackTrace, ex.Message, "Error to initialization settings from database."));
            }

            this.CanStop             = true;
            this.CanPauseAndContinue = true;
            this.AutoLog             = true;
            this.ServiceName         = this.Settings.ServiceName;
            EventLog.Source          = this.ServiceName;
            this.Logger     = new Logger(string.Format("{0}.{1}", this.ServiceName, "log"), this.ServiceName);
            this.Timer      = new Timer();
            this.FtpManager = new ManagerFtp(this.Settings.FtpUri, Convert.ToBoolean(this.Settings.FtpIsPassive),
                                             this.Settings.FtpTimeoutSec, this.Logger);
            this.WayBillRepository     = new WayBillRepository();
            this.TradeObjectRepository = new TradeObjectRepository();
        }
Example #2
0
 public void Test()
 {
     ManagerFtp ftp = new ManagerFtp("ftp://192.168.5.5", true, 30, new Logger("TestLog.log", ""));
 }