C# - Gets the current wallpaper path

By , 9/15/2008
(1 ratings)
Gets the current wallpaper path

needed namespace: Microsoft.Win32;
Translate to VB
/// <summary>
/// Gets the current wallpaper path.
/// </summary>
/// <returns>the wallpaper path</returns>
private static string GetCurrentWallpaperPath()
{
    RegistryKey wallPaper = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", false);
    string WallpaperPath = wallPaper.GetValue("WallPaper").ToString();
    wallPaper.Close();
    return WallpaperPath;
}

Tagged with wallpaper, path.

Comments

 

Log in, to comment!

Related Snippets