Click here to Skip to main content
15,921,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
code for creating folder with progress bar using c#.net
Posted
Comments
CHill60 6-Feb-13 5:10am    
Try rewording your question by posting what you have done so far and what your problem is

Creating a folder isn't something that will take any appreciable amount of time, and isn't something that provides the hook points that you could use to report progress on. Creating a folder is simply a case of calling Directory.CreateDirectory, as long as you have the relevant permissions to create the folder in the relevant place.
 
Share this answer
 
Hi,
I have a button and progress bar control in the form. Below code will create folders in c:\ while button click.

C#
private void button2_Click(object sender, EventArgs e)
        {
            string[] folderName = { "One", "Two", "Three", "Four", "Five" };

            progressBar1.Value = 0;
            for (int i = 0; i < 5; i++)
            {
                Directory.CreateDirectory("c:\\" + folderName[i]);
                progressBar1.Value += 20; //Since I am creating 5 directory , I am incrementing 20 (100/5)
            }


        }


Best Regards
Muthuraja
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900