I've checked this thread How to get files in a relative path in C#, the directory is in IDE, which is not correct for me. I have a website application, needs to get image files from the same level folder img
. I can use following code to get them:
DirectoryInfo path=new DirectoryInfo(@"c:\WebsiteSolution\wwwroot\Chat\img");
FileInfo[] images = path.GetFiles("*");
But I want to use something like .\img
to replace the parameter in the first line code, is that possible?