Пример #1
0
        private void LoadCurrentBackup()
        {
            //MessageBox.Show(comboBox1.SelectedItem.GetType().ToString());
            //的确 后缀是iphonebackup
            if (comboBox1.SelectedItem.GetType() != typeof(IPhoneBackup))
            {
                return;
            }
            var backup = (IPhoneBackup)comboBox1.SelectedItem;//back此时代表我的备份

            files92 = null;
            try
            {
                // File.Exists()  判断文件是否存在
                //Manifest.mbdb文件中存储与备份文件关联的文件名列表
                //我的备份中没有Manifest.mbdb   但有Manifest.db
                if (File.Exists(Path.Combine(backup.path, "Manifest.mbdb")))
                {
                    files92 = mbdbdump.mbdb.ReadMBDB(backup.path, "com.tencent.xin");
                }
                else if (File.Exists(Path.Combine(backup.path, "Manifest.db")))
                {
                    //string Combine(params string[] paths)  将字符串数组组合成一个路径
                    //com.tencent.xin  这个可能是跟微信相关的一个文件不知道是什么
                    files92 = V10db.ReadMBDB(Path.Combine(backup.path, "Manifest.db"), "com.tencent.xin");
                }
                if (files92 != null && files92.Count > 0)
                {
                    label2.Text      = "正确";
                    label2.ForeColor = Color.Green;
                    button2.Enabled  = true;
                }
                else
                {
                    label2.Text      = "未找到";
                    label2.ForeColor = Color.Red;
                    button2.Enabled  = false;
                }
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(ex.InnerException.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
            }
        }
Пример #2
0
        private void LoadCurrentBackup()
        {
            if (comboBox1.SelectedItem.GetType() == typeof(IPhoneBackup))
            {
                //判断选择的itune备份路径是否正确
                var backup = (IPhoneBackup)comboBox1.SelectedItem;

                files92 = null;
                try
                {
                    if (File.Exists(Path.Combine(backup.path, "Manifest.mbdb")))
                    {
                        files92 = mbdbdump.mbdb.ReadMBDB(backup.path, "com.tencent.xin");
                    }
                    else if (File.Exists(Path.Combine(backup.path, "Manifest.db")))
                    {
                        files92 = V10db.ReadMBDB(Path.Combine(backup.path, "Manifest.db"), "com.tencent.xin");
                    }
                    if (files92 != null && files92.Count > 0)
                    {
                        label2.Text          = "正确";
                        label2.ForeColor     = Color.Green;
                        exportButton.Enabled = true;
                    }
                    else
                    {
                        label2.Text          = "未找到";
                        label2.ForeColor     = Color.Red;
                        exportButton.Enabled = false;
                    }
                }
                catch (InvalidOperationException ex)
                {
                    MessageBox.Show(ex.InnerException.ToString());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
                }
            }
        }