HOW TO CREATE NEW FOLDER IN C# ON BUTTON CLICK?

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
C# 
C#
 3948  View(s)
Ratings:
Rate this:
Hi Expert,

I want to create new folder on button click event in C#. 
Please provide line of code or any article/blog links!

Thanks in advance. 
  1. Vijay Shukla

    Post:100

    Points:700
    Re: how to create new folder in c# on button click?

    Hello Brad pitt!
    Below is a small code snippets for creating a folder or directory in C#.

    public partial class Form1 : Form
    {
        public Form1()
        {
                InitializeComponent();
        }
        private void button_Click(object sender, EventArgs e)
        {
    System.IO.Directory.CreateDirectory(@"c:\mindstick");
        }
    }

      Modified On Jun-08-2013 08:32:26 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!