コード例 #1
0
ファイル: BLLUpload.cs プロジェクト: ufo20020427/FileUpload
        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
ファイル: FormMain.cs プロジェクト: ufo20020427/FileUpload
        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);
            }
        }