foreach file in a folder c# code example Example: c# loop through files in folder string[] files = Directory.GetFiles(txtFolderPath.Text, "*ProfileHandler.cs");