Exemple #1
0
        public static FolderBrowserDialogEx ComputerBrowser()
        {
            FolderBrowserDialogEx x = new FolderBrowserDialogEx();

            // avoid MBRO comppiler warning when passing _rootFolderLocation as a ref:
            x.BecomeComputerBrowser();
            return(x);
        }
Exemple #2
0
        private void dropFile_Click(object sender, EventArgs e)
        {
            var dlg1 = new FolderBrowserDialogEx();

            dlg1.Description             = "请选择想要上传的文件或文件夹";
            dlg1.ShowNewFolderButton     = true;
            dlg1.ShowEditBox             = true;
            dlg1.NewStyle                = true;
            dlg1.ShowFullPathInEditBox   = true;
            dlg1.RootFolder              = System.Environment.SpecialFolder.MyComputer;
            dlg1.ShowBothFilesAndFolders = true;

            // 判断用户是否正确的选择了文件
            if (dlg1.ShowDialog() == DialogResult.OK)
            {
                this.FilePath.Text         = dlg1.SelectedPath;
                this.uploadIcon.Visible    = false;
                this.uploadMessage.Visible = false;
            }
        }