public static string GetTitleID(string ISOFile) { FileStream ISO = File.OpenRead(ISOFile); DiscUtils.Iso9660.CDReader cdr = new DiscUtils.Iso9660.CDReader(ISO, false); Stream ParamSfo = cdr.OpenFile(@"PSP_GAME\PARAM.SFO", FileMode.Open, FileAccess.Read); Dictionary <string, object> SfoKeys = Sfo.ReadSfo(ParamSfo); string TitleID = (string)SfoKeys["DISC_ID"]; ISO.Close(); return(TitleID); }
private void UpdateBackupList() { BackupList.Items.Clear(); try { string CmaDir = CMADir.Text; string Aid = AIDSelector.Text; string BackupPath; if (!PSGame) { BackupPath = Path.Combine(CmaDir, "PGAME", Aid); } else { BackupPath = Path.Combine(CmaDir, "PSGAME", Aid); } foreach (string Dir in Directory.GetDirectories(BackupPath)) { try { string SfoPath = Path.Combine(BackupPath, Dir, "sce_sys", "param.sfo"); FileStream SfoStream = File.OpenRead(SfoPath); Dictionary <string, object> SfoKeys = Sfo.ReadSfo(SfoStream); string Title = (string)SfoKeys["TITLE"]; SfoStream.Close(); string BackupName = (Path.GetFileName(Dir) + " - " + Title); BackupList.Items.Add(BackupName); } catch (Exception) { BackupList.Items.Add(Path.GetFileName(Dir)); } } } catch (Exception) { } }