Code to see if a particular directory exists or not in a drive

Posted by Karthikanbarasan under C# category on | Points: 40 | Views : 2674
using System.IO;
using System.Collections;

DirectoryInfo myDirInformation = new DirectoryInfo(strPath);
if (myDirInformation.Exists == false)
MessageBox.Show("Cannot find directory.", "Directory Not Found");

MessageBox.Show("Welcome!!!.", "Directory Found");

Comments or Responses

Login to post response