Example #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void init()
        {
            string url = "";

            if ((url = WallpaperProcess.getURL()) != "0")
            {
                setStatusLabel.Text      = "正在设置壁纸";
                setStatusLabel.ForeColor = Color.Green;
                statusProgressBar.Value += 30;
                setProgramImage(url);//设置背景图片
            }
            else
            {
                statusProgressBar.Value  = 0;
                setStatusLabel.Text      = "获取失败";
                setStatusLabel.ForeColor = Color.Red;
                return;
            }
            initBackground();
            statusProgressBar.Value += 30;
            WallpaperProcess.setWallpaper();//设置墙纸
            setStatusLabel.Text      = "设置成功";
            statusProgressBar.Value  = 100;
            setStatusLabel.ForeColor = Color.Blue;
            changeDefaultSetting(int.Parse(ConfigOperation.getXmlValue(Application.StartupPath, "WallpaperSize")),
                                 int.Parse(ConfigOperation.getXmlValue(Application.StartupPath, "WallpaperStyle")));
        }
Example #2
0
 static void Main(string[] args)
 {
     WallpaperProcess.setWallpaper();
     //Console.WriteLine(dir);
     //Console.ReadLine();
 }