Try
'将MyFileName指定为一个图片文件的文件名
Dim MyFileName As String = Application.StartupPath & "\image\deskstopback.jpg"
If Not System.IO.File.Exists(MyFileName) Then
Return
End If
Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser
MyReg = MyReg.OpenSubKey("Control Panel\Desktop", True)
MyReg.SetValue("WallPaper", MyFileName)
MyReg.SetValue("TitleWallPaper", "2")
MyReg.Close()
' MessageBox.Show("设置注册表操作成功,重新启动计算机后即可生效!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
'MessageBox.Show(ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try转载请注明出处:
未经允许不得转载:lxfamn » vb.net 设置桌面壁纸