Exemple #1
0
        public void AddFtp()
        {
            if (this.ftpTempPath == null || this.ftpTempPath.Trim().Equals(string.Empty))
            {
                this.Hint = "临时路径不能为空!";
                return;
            }
            if (this.FtpOptions == null)
            {
                this.FtpOptions = new ObservableCollection <FtpGroupOption>();
            }

            FtpAddress addr = new FtpAddress();

            addr.FtpPath     = this.ftpTempPath.Trim();
            addr.FtpUserName = this.ftpUserName;
            addr.FtpPwd      = this.ftpPwd;
            FtpGroupOption op = new FtpGroupOption(addr);

            op.IsSelected = true;
            this.FtpOptions.Add(op);
            this.FtpTempPath = "";
            this.FtpUserName = "";
            this.FtpPwd      = "";
        }
Exemple #2
0
 public void Add()
 {
     if (this.aliasName == null || this.aliasName.Trim().Equals(string.Empty) ||
         this.path == null || this.path.Trim().Equals(string.Empty))
     {
         this.Hint = "地址名、FTP地址不能为空!";
     }
     else
     {
         FtpAddress item = new FtpAddress();
         item.FtpAlias = this.aliasName.Trim();
         item.FtpPath  = this.path.Trim();
         if (this.userName != null)
         {
             item.FtpUserName = this.userName.Trim();
         }
         else
         {
             item.FtpUserName = "";
         }
         if (this.pwd != null)
         {
             item.FtpPwd = this.pwd.Trim();
         }
         else
         {
             item.FtpPwd = "";
         }
         this.ContactList.Add(item);
         config.ListFtpAddr = this.contactList.ToList();
         config.WriteConfigToFile();
         this.Hint      = "FTP地址保存成功!";
         this.AliasName = "";
         this.Path      = "";
         this.UserName  = "";
         this.Pwd       = "";
     }
 }
Exemple #3
0
 public FtpGroupOption(FtpAddress addr)
 {
     this.Address    = addr;
     this.IsSelected = false;
 }