Im looking for a way to find all files in an shared special folder (Virtual Folder).
The Desktop
for example is an shared folder, there is a public Desktop
for all users and a private Desktop
. By navigating with the file explorer to Desktop
you will see the contents of both desktops merged together.
Example:
Shared folder for all:
dir C:\Users\Public\Desktop
Testfile1
Testfile2
Folder for the current user:
dir C:\Users\usera\Desktop
Testfile3
Testfile4
Now I want to get all files from Testfile1
till Testfile4
by looping trough C:\Users\usera\Desktop
Someone has a clue howto get a list of the files of both directories merged together? Also not only for Desktop, there are other folders that behave the same way.
Pseudocode:
arrayDesktop = FunctionThatGetsAllFilesFrom(@"C:\Usera\Desktop");
foreach (var file in arrayDesktop)
{
Console.WriteLine(file);
}
this should now print out
Testfile1
Testfile2
Testfile3
Testfile4