I'm trying to access the filePaths string from the listFilesInDirectory method outside of the main but it is giving me the following error: "The name 'filePaths' does not exist in the current context"
internal class Program
{
static void listFilesInDirectory(string workingDirectory)
{
// Let's find some files
string[] filePaths = Directory.GetFiles(workingDirectory);
}
static void Main(string[] args)
{
listFilesInDirectory(@"C:\Temp");
foreach (string filePath in filePaths)
{
Console.WriteLine(filePath);
}
}
}