Reputation: 1369
I want to get the list of files in a folder. This is my code:
var files = Directory.GetFiles("c:\\");
foreach (var f in files)
{
Console.WriteLine(f);
}
My expectation:
C:\bootmgr
C:\BOOTNXT
C:\hiberfil.sys
C:\pagefile.sys
C:\swapfile.sys
But I got:
C:\a
C:\b
C:\c
a, b, c
are files in working directory: C:\Code\test\bin\Debug
Is there a way to do it right?
Upvotes: 0
Views: 1028