Verify path is directory or file in C#

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

             {
                 MessageBox.Show("Directory");

             }
              if(System.IO.File.Exists(path))
            {
                 MessageBox.Show("File");
            }
Ebook Download
View all
Learn
View all