/// <summary>
        /// 保存存储策略
        /// </summary>
        /// <param name="model"></param>
        /// <returns>true:成功;false:失败</returns>
        private bool SaveStorageInfo(CommonParamViewModel model)
        {
            FileServer fileServer = this.Engine.FilePolicyManager.GetDefaultFileServer();

            OThinker.H3.DataModel.FileDownloadType downloadType = (OThinker.H3.DataModel.FileDownloadType) int.Parse(model.ClientMethod);
            OThinker.H3.DataModel.FileStorageType  storageType  = (OThinker.H3.DataModel.FileStorageType) int.Parse(model.StorageMethod);
            fileServer.DbCode       = model.SQLPool;
            fileServer.Account      = model.FTPAcount;
            fileServer.ServerHost   = model.FTPServer;
            fileServer.ServerPort   = string.IsNullOrEmpty(model.FTPServerPort) ? 21 : int.Parse(model.FTPServerPort);
            fileServer.Password     = model.FTPPassWord;
            fileServer.DownloadUrl  = model.FTPUrl;
            fileServer.DownloadType = downloadType;
            fileServer.StorageType  = storageType;
            fileServer.BasePath     = model.BasePath ?? "";
            return(this.Engine.FilePolicyManager.UpdateFileServer(fileServer));
        }
        /// <summary>
        /// FTP信息验证
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private bool FtpValidateResult(CommonParamViewModel model)
        {
            FileServer fileServer = this.Engine.FilePolicyManager.GetDefaultFileServer();

            // 检查数据库连接
            OThinker.H3.DataModel.FileStorageType  storageType  = (OThinker.H3.DataModel.FileStorageType) int.Parse(model.StorageMethod);
            OThinker.H3.DataModel.FileDownloadType downloadType = (OThinker.H3.DataModel.FileDownloadType) int.Parse(model.ClientMethod);
            fileServer.StorageType = storageType;
            string password = model.FTPPassWord;

            if (!string.IsNullOrEmpty(password))
            {
                fileServer.Password = password;
            }

            if (storageType == FileStorageType.FTP)
            {
                FtpWebRequest ftpRequest;
                try
                {
                    if (!string.IsNullOrEmpty(model.FTPServerPort))
                    {
                        ftpRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + model.FTPServer.Trim() + ":" + model.FTPServerPort.Trim() + "/"));
                    }
                    else
                    {
                        ftpRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + model.FTPServer.Trim() + "/"));
                    }

                    ftpRequest.Method      = WebRequestMethods.Ftp.ListDirectory;
                    ftpRequest.UseBinary   = true;
                    ftpRequest.Credentials = new NetworkCredential(model.FTPAcount, fileServer.Password);
                    FtpWebResponse response = (FtpWebResponse)ftpRequest.GetResponse();
                }
                catch
                {
                    return(false);
                }
            }
            return(true);
        }