Using system;
USING Microsoft.win32;
Namespace SystemPathApp
{
///
/// Summary Description for SystemPaths.
/// summary>
Public Class SystemPaths
{
Public systempaths ()
{
//
// Todo: add constructor logic here
//
Folders = OpenRegistryPath (Registry.currentuser, @ "/ soft / microsoft / windows / currentversion / explorer / shell folders);
}
Private registryKey folders;
Private RegistryKey OpenRegistryPath (RegistryKey root, String s)
{
S = S.Remove (0, 1) @ "/";
While (sindexof (@ "/")! = -1)
{
Root = root.opensubkey (s.substring (0, s.indexof (@ "/"))));
s = S.Remove (0, S.indexof (@ "/") 1);
}
Return root;
}
///
/// summary>
///
/// Desktop Desktop Directory
/// fonts font directory
/// NetHood online neighbor
/// Personal My Document Directory
/// programs Start menu program directory
/// rextrain storage directory recently accessed file shortcut
/// sendto sends to the directory
/// StartMenu Start Menu Directory
/// STARTUP Start Menu Startup Project Record
/// Favorites Favorites Directory
/// history webpage history catalog
/// cookies cookies directory
/// cache cache directory
/// appdata application data directory
///Printhood print catalog
/// param>
///
Public String Customize (String Path)
{
Return folders.getValue (path) .tostring ();
}
Public String Desktop ()
{
Return Customize ("Desktop");
}
Public String cookies ()
{
Return Customize ("Cookies");
}
Public string myDocuments ()
{
Return Customize ("Personal");
}
Public String History ()
{
Return Customize ("History");
}
Public string favorites ()
{
Return Customize ("Favorites");
}
}
}