What you are doing (ironically) is that you are returning the same argument that was passed to the function. :laugh: What you need to do is, that you need to get the files from a directory and System.IO has everything that you need for this task.
public static IEnumerable<string> GetFiles(string path)
{
return path.AsDirectory().GetFiles();
}
public static IEnumerable<string> GetFiles(string path) {
return Directory.GetFiles(path).ToList();
}
This would do the trick that you want it to do. Also note that this only returns the file names, not the directories — there is a different function in the System.IO namespace for that, look for it. :-)
Finally, just return the list (why are you returning a string? Obviously it should be a list of all the files).
Directory.GetFiles Method (String) (System.IO)[
^]