Check out example codes for "c# get number of files in directory". It will help you in understanding the concepts better.

Code Example 1

int count = System.IO.Directory.EnumerateFiles(String path).Count();

Learn ReactJs, React Native from akashmittal.com