Blog

How to create folder

Posted by Owais Khan Blogs | Files, Directory, IO Sep 22, 2010
How to create folder in c#.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.IO;

namespace CreateFolder

{

    class Program

    {

        static void Main(string[] args)

        {

            DirectoryInfo dir = new DirectoryInfo(@"E:\owais");

            if (dir.Exists)

                Console.WriteLine("The Folder Exist");

            else

            {

                dir.Create();

                Console.WriteLine("Folder Create");

            }

            Console.WriteLine(Console.Read());

        }

    }

}

COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.