Click here to Skip to main content
15,941,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Under Win7, in the explorer view there is a new feature called "Libaries" which have links to "Pictures", "documents" etc(plus you can add your own).
These libraries are virtual paths.

In either VB.Net of C#:
Can anyone please tell me how I can get the full physical path of any of the libaries?
Lets say for example "Pictues" how do I get the full path.

Thanks
Posted
Updated 10-Sep-10 22:32pm
v2

Here is an MSDN article on Windows 7 Libraries, and details on how to select and consume them.

http://msdn.microsoft.com/en-us/magazine/dd861346.aspx[^]

Also if you look at My.Computer.FileSystem.SpecialDirectories
you can get access to MyPictures, MyMusic, Desktop etc.
 
Share this answer
 
C#
string SpecialDir(string name = "MyPictures")
       {
           Dictionary<string, string> specDir = new Dictionary<string, string>();
           foreach (System.Environment.SpecialFolder sFolder in Enum.GetValues(typeof(System.Environment.SpecialFolder)))
           {
               try
               {
                   specDir.Add(sFolder.ToString(), System.Environment.GetFolderPath(sFolder));
               }
               catch
               {
                   // Try-Catch to ignore Duplication
               }
           }
           return specDir[name];
       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900