コード例 #1
0
        private void cmdBrowse_Click(object sender, EventArgs e)
        {
            switch (BW)
            {
            case BrowseWhere.Local:
                FolderBrowserDialog fldr = new FolderBrowserDialog();
                fldr.RootFolder          = Environment.SpecialFolder.MyComputer;
                fldr.ShowNewFolderButton = false;
                fldr.Description         = "Select folder";
                if (fldr.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                txtTo.Text = fldr.SelectedPath;
                break;

            case BrowseWhere.Remote:
                ComputerData cd = Program.net.GetComputerDetail(MID);
                if (cd == null)
                {
                    MessageBox.Show(this, "Cannot get computer informations", Program.Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                frmRemoteBrowseFolder frm = new frmRemoteBrowseFolder(MID, cd.SystemRoot, "Select folder", Program.net);
                if (frm.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                txtTo.Text = frm.SelectedFolder;
                break;
            }
        }
コード例 #2
0
        private void cmdDir_Click(object sender, EventArgs e)
        {
            frmRemoteBrowseFolder fldr = new frmRemoteBrowseFolder(MID, cd.SystemRoot, "Copy files from " + ComputerName, Program.net);

            if (fldr.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            RecurseFolders(fldr.SelectedFolder);
        }