Solved

Folder Batches

Posted on 2003-12-05
4
300 Views
Last Modified: 2010-04-16
How can I use a Dialog box to select either a folder, or a group of files to be used for a batch job?
0
Comment
Question by:derekthornton
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
testn earned 500 total points
ID: 9882698
   this.OpenFileDialog1 = new System.Windows.Forms.OpenFileDialog();

    // Set the file dialog to filter for graphics files.
    this.OpenFileDialog1.Filter =
        "Images (*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|" +
        "All files (*.*)|*.*";

    // Allow the user to select multiple images.
    this.OpenFileDialog1.Multiselect = true;                           // <---- -Set Multi select to be true
    this.OpenFileDialog1.Title = "My Image Browser";

then....

if you hook up with fileok event, you can retrieve list of selected file from

private void OpenFileDialog1_FileOk(object sender,
    System.ComponentModel.CancelEventArgs e)
{
     string[] files = OpenFileDialog1.FileNames;
}
0
 
LVL 2

Author Comment

by:derekthornton
ID: 9882728
Alright.That lets me select a group of files, but what if I want to just select a whole folder instead?
0
 
LVL 18

Expert Comment

by:testn
ID: 9882931
0
 
LVL 3

Expert Comment

by:Mariano_Peterson
ID: 9899838
So, is there no way to select a group of folders?  I followed the link but couldn't find anything about selecting multiple folders.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question