Exemplo n.º 1
0
        //上传动作
        private void DoUploadWork(object sender, DoWorkEventArgs e)
        {
            UploadArg fileNames = e.Argument as UploadArg;

            FSClient fs = new FSClient();

            fs.MutUpload(worker, fileNames.FilePathList, ConfigHelper.HdfsRoot + CurrentPath, fileNames.LocalFileRoot);
        }
Exemplo n.º 2
0
        //点击 上传文件夹
        private void MenuItemUploadFloder_Click(object sender, EventArgs e)
        {
            UploadArg fileNames = GetFilesInFolder();

            if (fileNames.FilePathList.Count > 0)
            {
                worker.DoWork             += new DoWorkEventHandler(DoUploadWork);
                worker.ProgressChanged    += new ProgressChangedEventHandler(ProgessChanged);
                worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompleteUploadWork);

                worker.RunWorkerAsync(fileNames);
            }
        }
Exemplo n.º 3
0
        private UploadArg GetFilesInFolder()
        {
            UploadArg           ua = new UploadArg();
            FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
            //folderBrowserDialog.RootFolder = System.Environment.SpecialFolder.Desktop;
            DialogResult results = folderBrowserDialog.ShowDialog();

            if (results == DialogResult.OK)
            {
                try
                {
                    string pathName = folderBrowserDialog.SelectedPath;
                    GetFilesFromDic(pathName, ua.FilePathList);
                    ua.LocalFileRoot = pathName;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("错误: 读取文件失败。 " + ex.Message);
                }
            }
            return(ua);
        }
Exemplo n.º 4
0
 private UploadArg GetFilesInFolder()
 {
     UploadArg ua = new UploadArg();
     FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
     //folderBrowserDialog.RootFolder = System.Environment.SpecialFolder.Desktop;
     DialogResult results = folderBrowserDialog.ShowDialog();
     if (results == DialogResult.OK)
     {
         try
         {
             string pathName = folderBrowserDialog.SelectedPath;
             GetFilesFromDic(pathName, ua.FilePathList);
             ua.LocalFileRoot = pathName;
         }
         catch (Exception ex)
         {
             MessageBox.Show("错误: 读取文件失败。 " + ex.Message);
         }
     }
     return ua;
 }
Exemplo n.º 5
0
        //上传动作
        private void DoUploadWork(object sender, DoWorkEventArgs e)
        {
            UploadArg fileNames = e.Argument as UploadArg;

            client.MutUpload(worker, fileNames.FilePathList, CurrentPath, fileNames.LocalFileRoot);
        }