我的老板要求我从http下载jpg文件并定期将其更改为壁纸,这是我的代码
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", "http://defsite.com/wallpaper/wallpaper.jpg", False
xHttp.Send
with bStrm
.type = 1 '//binary
.open
.write xHttp.responseBody
.savetofile "C:\Documents and Settings\Administrator\My Documents\My Pictures\Wallpaper\wallpaper.jpg", 2 '//overwrite
end with
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\windows\system32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
但是,WshShell.Run无法在屏幕上更新,操作系统是XP。有什么想法吗?
请咨询!