public void LoadData()
        {
            label1.Content = SelectedPath;
            string        userPath = null;
            string        path     = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Packages";
            DirectoryInfo root     = new DirectoryInfo(path);

            DirectoryInfo[] dics = root.GetDirectories();
            foreach (DirectoryInfo di in dics)
            {
                if (di.Name.StartsWith("Microsoft.Windows.ContentDeliveryManager_"))
                {
                    userPath = di.FullName + @"\LocalState\TargetedContentCache";
                    break;
                }
            }
            DirectoryInfo userDi = new DirectoryInfo(userPath);

            DirectoryInfo[] userDis = userDi.GetDirectories();
            foreach (DirectoryInfo di in userDis)
            {
                DirectoryInfo[] ds = di.GetDirectories();
                foreach (DirectoryInfo d in ds)
                {
                    FileInfo[] files = d.GetFiles();
                    foreach (FileInfo file in files)
                    {
                        string text             = File.ReadAllText(file.FullName);
                        JavaScriptSerializer js = new JavaScriptSerializer(); //实例化一个能够序列化数据的类
                        Info info = js.Deserialize <Info>(text);              //将json数据转化为对象类型并赋值给list
                        if (info.Name == "LockScreen")
                        {
                            InfoProperties infoProperties = info.Properties;
                            IpList.Add(infoProperties);

#if DEBUG
                            string mydir     = System.Environment.CurrentDirectory;
                            int    pos       = mydir.LastIndexOf("MyCShapeWPF");
                            string baseMydir = mydir.Substring(0, pos);
                            string imageDir  = baseMydir + @"images\";
                            string jsonDir   = baseMydir + @"json\";
                            File.WriteAllText(jsonDir + file.Name + ".json", text);
                            LandscapeImage li     = infoProperties.LandscapeImage;
                            string         liPath = li.Image;
                            File.WriteAllBytes(imageDir + liPath.Substring(liPath.LastIndexOf('\\') + 1) + ".jpg", File.ReadAllBytes(liPath));
                            PortraitImage pi     = infoProperties.PortraitImage;
                            string        piPath = pi.Image;
                            File.WriteAllBytes(imageDir + piPath.Substring(piPath.LastIndexOf('\\') + 1) + ".jpg", File.ReadAllBytes(piPath));
#endif
                        }
                    }
                }
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (SelectedPath == null)
            {
                MessageBox.Show("Please select a folder to save images.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }
            foreach (InfoProperties ip in IpList)
            {
                LandscapeImage landscapeImage = ip.LandscapeImage;
                PortraitImage  portraitImage  = ip.PortraitImage;
                string         li             = landscapeImage.Image;
                string         pi             = portraitImage.Image;
                //线程异步调用复制文件
                Thread cp1   = new Thread(new ParameterizedThreadStart(CopyFile));
                int    pos1  = li.LastIndexOf("\\");
                string name1 = li.Substring(pos1 + 1);
                object o1    = new CopyFileInfo()
                {
                    From = li,
                    To   = SelectedPath + "\\" + name1 + ".jpg"
                };
                cp1.Start(o1);

                Thread cp2   = new Thread(new ParameterizedThreadStart(CopyFile));
                int    pos2  = pi.LastIndexOf("\\");
                string name2 = pi.Substring(pos2 + 1);
                object o2    = new CopyFileInfo()
                {
                    From = pi,
                    To   = SelectedPath + "\\" + name2 + ".jpg"
                };
                cp2.Start(o2);

                MessageBox.Show("Save Images success!", "Notification", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }