public static List <string> GetFileNames(string dir) { List <string> result = new List <string>(); IXboxFiles files = jtag.DirectoryFiles(dir); foreach (IXboxFile file in files) { if (!file.IsDirectory) { result.Add(file.Name.Substring(dir.Length)); } } return(result); }
public static ListItem GetXboxProfileFile(IXboxConsole xboxConsole, Form owner) { List<ListItem> consoleProfiles = new(); List<string> consoleProfilesPaths = new(); IXboxFiles xboxFiles = xboxConsole.DirectoryFiles(@"Hdd:\Content\"); foreach (IXboxFile file in xboxFiles) { if (file.IsDirectory) { MessageBox.Show(file.Name); if (!file.Name.Contains("0000000000000000")) { consoleProfilesPaths.Add(file.Name); } } } foreach (string profile in consoleProfilesPaths) { string profilePath = @$"Hdd:\Content\{profile.Replace(@"Hdd:\Content\", "")}\FFFE07D1\00010000\"; try { foreach (IXboxFile file in xboxConsole.DirectoryFiles(profilePath)) { if (!file.IsDirectory) { string profileName = profile.Replace(@"Hdd:\Content\", "").Replace(@"\FFFE07D1\00010000\", ""); consoleProfiles.Add(new() { Name = profileName, Value = file.Name }); } } } catch { // Profile file doesn't exist, so skip to next one continue; } }