c# get list of files containing string code example
Example 1: get directory of file c#
using System.IO;
string file = "C:\Documents\file.txt";
Path.GetDirectoryName(file);
Example 2: asp.net list all files in folder
string[] allfiles = Directory.GetFiles("path/to/dir", "*.*", SearchOption.AllDirectories);