实现方法:
using System.Runtime.InteropServices; private const int SPI_SETDESKWALLPAPER = 20; [DllImport("user32.dll", EntryPoint = "SystemParametersInfoA")] static extern Int32 SystemParametersInfo(Int32 uAction, Int32 uParam, string lpvParam, Int32 fuWinIni);//lpvParam要设置成string
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, filename, 1);//调用,filename为图片地址,最后一个参数需要为1,0的话在重启后就变回原来的了
每日必应壁纸接口:https://spidersharp.com/wallpaper/
评论前必须登录!
注册