To check if Directory has Files in C# and VB.NET you can use the following snippet.
Sample C#
public static bool HasFilesInFolder(DirectoryInfo folder) { return folder.GetFiles("*.*").Any(); }
Sample VB.NET
Public Shared Function HasFilesInFolder(folder As DirectoryInfo) As Boolean Return folder.GetFiles("*.*").Any() End Function
RT @CodeSnippetsNET: Check if Directory has Files in C# and #VB .NET http://t.co/PQzDq6ALN6 #csharp #dotnet #code #dev