Exemple #1
0
        static void Main(string[] args)
        {
            Settings.Load();
            Account = new AccountController();
            Account = Settings.DefaultProfile;

            // Allocate console
            if (args.Length > 0 && args.Contains("-console"))
                aConsole.Allocate();

            Settings.IsDebugMode = args.Contains("-debug");
            Settings.IsNoMenusMode = args.Contains("-nomenus");

            Log.Init(Common.DebugLogPath, l.Debug | l.Info | l.Warning | l.Error | l.Client, true, Settings.IsDebugMode);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (!DLLsExist)
            {
                MessageBox.Show("The required DLL files to run this program are missing. Please make sure all the needed files are in the installation folder and then run the application. If you cannot find these files, just reinstall FTPbox.", "FTPbox - Missing Resources", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Process.GetCurrentProcess().Kill();
            }
            else
            {
                if (CheckArgs(args))
                {
                    KillUnecessaryDLLs();
                    CheckForPreviousInstances();
                    Application.Run(new fMain());
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Saves Profiles & General settings to the config file
        /// </summary>
        public static void Save(AccountController account = null)
        {
            SaveGeneral();

            SaveProfile(account);

            SaveCertificates();
        }
Exemple #3
0
        public FileLog(AccountController account)
        {
            _controller = account;

            Files = new List<FileLogItem>();
            Folders = new List<string>();

			Log.Write(l.Info, "Opened FileLog");
		}
Exemple #4
0
        private Thread _wiThread; // Upload or remove the web interface thread

        #endregion Fields

        #region Constructors

        public WebInterface(AccountController account)
        {
            this.controller = account;
            _wiThread = new Thread(StartUpdate);
        }
Exemple #5
0
 public FolderWatcher(AccountController account)
 {
     this.controller = account;
 }
Exemple #6
0
        /// <summary>
        /// Puts data from Profile Class to the Profiles list
        /// and then saves the Profiles list to the config file
        /// </summary>
        public static void SaveProfile(AccountController account = null)
        {
            var def = account ?? Profiles[General.DefaultProfile];

            if (General.DefaultProfile >= Profiles.Count)
                Profiles.Add(def);
            else
                Profiles[General.DefaultProfile] = def;

            string config_prof = JsonConvert.SerializeObject(Profiles, Formatting.Indented);
            File.WriteAllText(confProfiles, config_prof);
        }
Exemple #7
0
        private SftpClient _sftpc; // And our SFTP client

        #endregion Fields

        #region Constructors

        public Client(AccountController account)
        {
            this.controller = account;
            this.Certificates = new X509Certificate2Collection();
        }
Exemple #8
0
 public Client(AccountController account)
 {
     _controller = account;
     _certificates = new X509Certificate2Collection();
 }
Exemple #9
0
        private SftpClient _sftpc; // And our SFTP client

        #endregion Fields

        #region Constructors

        public Client(AccountController account)
        {
            this.controller = account;
        }
Exemple #10
0
 public SyncQueueItem(AccountController account)
 {
     controller = account;
 }
Exemple #11
0
 public FolderWatcher(AccountController account)
 {
     this.controller = account;
 }
Exemple #12
0
 public SftpClient(AccountController account)
 {
     Controller = account;
 }
Exemple #13
0
 public SizeTransferValidator(AccountController controller)
 {
     Controller = controller;
 }
Exemple #14
0
 public Client(AccountController account)
 {
     this.controller   = account;
     this.Certificates = new X509Certificate2Collection();
 }