Feedback

Pfad des Desktop Hintergrundbild ermitteln

Sprache: C#

Diese Methode gibt den Pfad zum aktuellen Desktop Hintergrundbild zurück. benötigter Namespace: using Microsoft.Win32;
/// <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;
}
/// <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;
}

1 Kommentar