[Solved] I need to find the file path and file name of a file that matches the string lastline [closed]


try
        {
            string lastline = "Controller"; // assuming you know the file your searching for
            foreach (string filePaths in Directory.GetDirectories(@"E:\Program Files (x86)\foobar2000\library\"))
            {
                foreach (string f in Directory.GetFiles(filePaths, "*" + lastline + "*.*"))
                {
                    Console.WriteLine(f); // would print the filepath n the file name

                }
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }

Hope this helps.

12

solved I need to find the file path and file name of a file that matches the string lastline [closed]