Check if the folder has a files


#1

Good day,
I need to check if the folder has a files if theirs a file the program will continue the process unless if the folder is no files the program will show message box “no files found”

thank you for your concern,


#2

@zellec

  1. Use below command to get files in that directory and assign output to string array.

         Directory.GetFiles("Ur folder path") 
    
  2. check the length of the array. If length is greater than zero, then files exists in folder otherwise files not exists in folder.


#3

Also Directory.enumareteFiles and check Ienum lenght.


#4

thanks it works, :heart_eyes: