Saturday, January 8, 2011

Verify path is directory or file

string path=@"C:\Desktop";
           
            if (System.IO.Directory.Exists(path))

             {
                 MessageBox.Show("Directory");

             }
              if(System.IO.File.Exists(path))
            {
                 MessageBox.Show("File");
            }

No comments:

Post a Comment