示例#1
0
        private FTP Connect()
        {
            try {
                var ftp = new FTP {
                    Server = QuickSettings.StringSetting["ftp-server"],
                    User = QuickSettings.StringSetting["ftp-username"],
                    Password = QuickSettings.EncryptedStringSetting["ftp-password"]
                };
                ftp.Connect();
                return ftp;
            }
            catch {
                Invoke(() => {
                    if (AudioCues) {
                        errorBeep.Play();
                    }
                    ShowBalloonTip("Unable to upload file", "Couldn't log into ftp server", ToolTipIcon.Error);
                });

                return null;
            }
        }
        private FTP Connect()
        {
            try {
                var ftp = new FTP {
                    Server = RegistryView.ApplicationUser["#ftp-server"].StringValue,
                    User = RegistryView.ApplicationUser["#ftp-username"].StringValue,
                    Password = RegistryView.ApplicationUser["#ftp-password"].EncryptedStringValue
                };
                ftp.Connect();
                return ftp;
            }
            catch {
                Invoke(() => {
                    if (AudioCues) {
                        errorBeep.Play();
                    }
                    ShowBalloonTip("Unable to upload file", "Couldn't log into ftp server", ToolTipIcon.Error);
                });

                return null;
            }
        }