No idea why this isnt working its just a couple of .txt files and no expection is being outputted.
What I have tried:
try
{
string[] array2 = Directory.GetFiles(@"C:\Users\Public\LSH\SearchingDB\", "*.txt");
if (array2.Length == 0)
{
Console.WriteLine("No files found.");
}
foreach (string name in array2)
{
if (name.Contains(TextBox1.Text))
{
Console.WriteLine(name);
}
}
}
catch (Exception excpt)
{
Console.WriteLine(excpt);
}