How to discover which image file is the current de

2019-05-24 14:35发布

It is possible to discover it programatically? It will use the Windows Registry? I'll need to take a screenshot of it and compare with the files on disk? Is it possible to discover even in the desktop slideshow mode?

4条回答
干净又极端
2楼-- · 2019-05-24 14:51

The registry key is HKCU\Control Panel\Desktop\Wallpaper

查看更多
一纸荒年 Trace。
3楼-- · 2019-05-24 14:54
public string GetCurrentWallpaper()
{
    using(var subKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Desktop\General", false))
    {
        return subKey.GetValue("WallpaperSource").ToString();
    }
}
查看更多
对你真心纯属浪费
4楼-- · 2019-05-24 15:09

You need to use SystemParametersInfo() there is a tutorial on Geekpedia with more information on how to accomplish this with the different Windows OS's and systems.

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-05-24 15:10

try this

using Microsoft.Win32;

private string GetCurrentWallpaper()

{
 using(RegistryKey MyWallPaper = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", false))
 {
     return MyWallPaper.GetValue("WallPaper").ToString();
 }
}

Bye.

查看更多
登录 后发表回答