示例#1
0
        public BLLUpload(IFileUpload proxy, FileServerInfo fileServerInfo, ListBox listBoxUploadDirectory, ListBox listBoxSucessfulDirectory, ListBox listBoxFailDirectory)
        {
            _proxy = proxy;
            _fileServerInfo = fileServerInfo;
            _listBoxUploadDirectory = listBoxUploadDirectory;
            _listBoxSucessfulDirectory = listBoxSucessfulDirectory;
            _listBoxFailDirectory = listBoxFailDirectory;
            _isRun = false;
            _semaphoreTask = new Semaphore(ClientConfig.MaxThread, ClientConfig.MaxThread);

            _delegateTurnToSucessful = UploadDirectoryTurnToSucessful;
            _delegateTurnToFail = UploadDirectoryTurnToFail;
        }
示例#2
0
        public FileServerInfo FileServerInfoLoad()
        {
            DataTableResponse response = _proxy.GetFileServerInfoByEndPoint(ClientConfig.Token, ClientConfig.WCFAddress, ClientConfig.Account, ClientConfig.PassWord);
            DataTable dt = response.DataTable;

            if (dt == null || dt.Rows.Count == 0)
            {
                throw new Exception("加载文件服务器信息失败!");
            }

            FileServerInfo fileServerInfo = new FileServerInfo();
            fileServerInfo.Id = Convert.ToInt32(dt.Rows[0]["FSID"]);
            fileServerInfo.Name = dt.Rows[0]["FSName"].ToString();
            fileServerInfo.OriginalFileServerRootDirectory = dt.Rows[0]["OrgFilePath"].ToString();
            fileServerInfo.ThumbFileServerRootDirectory = dt.Rows[0]["ThumbFilePath"].ToString();

            return fileServerInfo;
        }
示例#3
0
        private void FileServerInfoLoad()
        {
            try
            {
                BLLFileServer bllFileServer = new BLLFileServer(_proxy);
                _fileServerInfo = bllFileServer.FileServerInfoLoad();

                this.Text = string.Format("素材上传 已连上:{0}({1})", ClientConfig.WCFAddress, _fileServerInfo.Name);
            }
            catch (Exception ex)
            {
                Tools.LogWrite(ex.ToString());
                throw new Exception("加载文件服务器信息失败:" + ex.Message);
            }
        }