Пример #1
0
        // Save text box values to settings
        private void btnOK_Click(object sender, EventArgs e)
        {
            EUISettings.uRootFolder  = tbxRootFolder.Text;
            EUISettings.uFolder401   = tbx401Folder.Text;
            EUISettings.uFolder410   = tbx410Folder.Text;
            EUISettings.uFolder411   = tbx411Folder.Text;
            EUISettings.uFolder420   = tbx420Folder.Text;
            EUISettings.uFolder500   = tbx500Folder.Text;
            EUISettings.uFolder510   = tbx510Folder.Text;
            EUISettings.uFTPUser     = tbxFTPUser.Text;
            EUISettings.uFTPPassword = tbxFTPPass.Text;
            EUISettings.uFTP401URL   = tbx401Url.Text;
            EUISettings.uFTP410URL   = tbx410Url.Text;
            EUISettings.uFTP411URL   = tbx411Url.Text;
            EUISettings.uFTP420URL   = tbx420Url.Text;
            EUISettings.uFTP500URL   = tbx500Url.Text;
            EUISettings.uFTP510URL   = tbx510Url.Text;

            EUISettings settings = new EUISettings();

            settings.RootFolder  = tbxRootFolder.Text;
            settings.Folder401   = tbx401Folder.Text;
            settings.Folder410   = tbx410Folder.Text;
            settings.Folder411   = tbx411Folder.Text;
            settings.Folder420   = tbx420Folder.Text;
            settings.Folder500   = tbx500Folder.Text;
            settings.Folder510   = tbx510Folder.Text;
            settings.FTPUser     = tbxFTPUser.Text;
            settings.FTPPassword = tbxFTPPass.Text;
            settings.FTP401URL   = tbx401Url.Text;
            settings.FTP410URL   = tbx410Url.Text;
            settings.FTP411URL   = tbx411Url.Text;
            settings.FTP420URL   = tbx420Url.Text;
            settings.FTP500URL   = tbx500Url.Text;
            settings.FTP510URL   = tbx510Url.Text;

            settings.SaveToAppSettings();

            this.Close();
        }
Пример #2
0
        //private Form2 settingsform = new Form2();

        public AppMainForm()
        {
            InitializeComponent();

            bgwGetFileFromFTP.WorkerReportsProgress = true;
            bgwGetFileFromFTP.DoWork                    += new DoWorkEventHandler(bgwGetFileFromFTP_DoWork);
            bgwGetFileFromFTP.ProgressChanged           += new ProgressChangedEventHandler(bgwGetFileFromFTP_ProgressChanged);
            bgwGetFileFromFTP.WorkerSupportsCancellation = true;
            bgwGetFileFromFTP.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(bgwGetFileFromFTP_RunWorkerCompleted);


            // When settings have not been edited, assign static variables to default values
            EUISettings.uRootFolder   = @"C:\Engenix\";
            EUISettings.uFolder401    = @"C:\Engenix\400\";
            EUISettings.uFolder410    = @"C:\Engenix\410\";
            EUISettings.uFolder411    = @"C:\Engenix\411\";
            EUISettings.uFolder420    = @"C:\Engenix\411\";
            EUISettings.uFolder500    = @"C:\Engenix\500\";
            EUISettings.uFolder510    = @"C:\Engenix\510\";
            EUISettings.uFTPUser      = "******";
            EUISettings.uFTPPassword  = ""; // Keep blank for security purposes
            EUISettings.uFTP401URL    = "ftp://www.3epcb.com/DailyBuild/Engenix%204.0.0/";
            EUISettings.uFTP410URL    = "ftp://www.3epcb.com/DailyBuild/Engenix%204.1.0/";
            EUISettings.uFTP411URL    = "ftp://www.3epcb.com/DailyBuild/Engenix%204.1.1/";
            EUISettings.uFTP420URL    = "ftp://www.3epcb.com/DailyBuild/Engenix%204.2.0/";
            EUISettings.uFTP500URL    = "ftp://www.3epcb.com/DailyBuild/Engenix%205.0.0/";
            EUISettings.uFTP510URL    = "ftp://www.3epcb.com/DailyBuild/Engenix%205.1.0/";
            EUISettings.pFTPRoot      = "ftp://www.3epcb.com/";
            EUISettings.pFTPInternal  = "ftp://www.3epcb.com/internal/";
            EUISettings.pDestFolder   = EUISettings.uRootFolder;
            EUISettings.pSourceFolder = EUISettings.uRootFolder;

            EUISettings getSettings = new EUISettings();

            getSettings.ReadFromAppSettings();

            // Get values from settings if they exist. Else default tbx values are used
            if (getSettings.RootFolder != "")
            {
                EUISettings.uRootFolder = getSettings.RootFolder;
            }

            if (getSettings.Folder401 != "")
            {
                EUISettings.uFolder401 = getSettings.Folder401;
            }

            if (getSettings.Folder410 != "")
            {
                EUISettings.uFolder410 = getSettings.Folder410;
            }

            if (getSettings.Folder411 != "")
            {
                EUISettings.uFolder411 = getSettings.Folder411;
            }

            if (getSettings.Folder420 != "")
            {
                EUISettings.uFolder420 = getSettings.Folder420;
            }

            if (getSettings.Folder500 != "")
            {
                EUISettings.uFolder500 = getSettings.Folder500;
            }

            if (getSettings.Folder510 != "")
            {
                EUISettings.uFolder510 = getSettings.Folder510;
            }

            if (getSettings.FTPUser != "")
            {
                EUISettings.uFTPUser = getSettings.FTPUser;
            }

            if (getSettings.FTPPassword != "")
            {
                EUISettings.uFTPPassword = getSettings.FTPPassword;
            }

            if (getSettings.FTP401URL != "")
            {
                EUISettings.uFTP401URL = getSettings.FTP401URL;
            }

            if (getSettings.FTP410URL != "")
            {
                EUISettings.uFTP410URL = getSettings.FTP410URL;
            }

            if (getSettings.FTP411URL != "")
            {
                EUISettings.uFTP411URL = getSettings.FTP411URL;
            }

            // Init textboxes with settings
            tbxSourceFolder.Text      = EUISettings.pSourceFolder;
            tbxDestinationFolder.Text = EUISettings.pSourceFolder;
        }
Пример #3
0
        public Form2()
        {
            InitializeComponent();

            EUISettings getSettings = new EUISettings();

            getSettings.ReadFromAppSettings();

            // Get values from settings if they exist. Else default tbx values are used
            if (getSettings.RootFolder != "")
            {
                tbxRootFolder.Text = getSettings.RootFolder;
            }

            if (getSettings.Folder401 != "")
            {
                tbx401Folder.Text = getSettings.Folder401;
            }

            if (getSettings.Folder410 != "")
            {
                tbx410Folder.Text = getSettings.Folder410;
            }

            if (getSettings.Folder411 != "")
            {
                tbx411Folder.Text = getSettings.Folder411;
            }

            if (getSettings.Folder420 != "")
            {
                tbx420Folder.Text = getSettings.Folder420;
            }

            if (getSettings.Folder500 != "")
            {
                tbx500Folder.Text = getSettings.Folder500;
            }

            if (getSettings.Folder510 != "")
            {
                tbx510Folder.Text = getSettings.Folder510;
            }

            if (getSettings.FTPUser != "")
            {
                tbxFTPUser.Text = getSettings.FTPUser;
            }

            if (getSettings.FTPPassword != "")
            {
                tbxFTPPass.Text = getSettings.FTPPassword;
            }

            if (getSettings.FTP401URL != "")
            {
                tbx401Url.Text = getSettings.FTP401URL;
            }

            if (getSettings.FTP410URL != "")
            {
                tbx410Url.Text = getSettings.FTP410URL;
            }

            if (getSettings.FTP411URL != "")
            {
                tbx411Url.Text = getSettings.FTP411URL;
            }

            if (getSettings.FTP420URL != "")
            {
                tbx420Url.Text = getSettings.FTP420URL;
            }

            if (getSettings.FTP500URL != "")
            {
                tbx500Url.Text = getSettings.FTP500URL;
            }

            if (getSettings.FTP510URL != "")
            {
                tbx510Url.Text = getSettings.FTP510URL;
            }
        }