private static void AddDirectoryTree(Iso9660Generator iso, string root, string virtualPrepend) { DirectoryInfo dirinfo = new DirectoryInfo(root.Replace('/', '\\')); foreach (FileInfo file in dirinfo.GetFiles()) iso.AddFile(virtualPrepend + file.Name, file); foreach (DirectoryInfo dir in dirinfo.GetDirectories()) { iso.MkDir(virtualPrepend + dir.Name); AddDirectoryTree(iso, root + '/' + dir.Name, virtualPrepend + dir.Name + '/'); } }
static private void AddDirectoryTree(Iso9660Generator iso, string root, string virtualPrepend) { DirectoryInfo dirinfo = new DirectoryInfo(root.Replace('/', '\\')); foreach (FileInfo file in dirinfo.GetFiles()) { iso.AddFile(virtualPrepend + file.Name, file); } foreach (DirectoryInfo dir in dirinfo.GetDirectories()) { iso.MkDir(virtualPrepend + dir.Name); AddDirectoryTree(iso, root + '/' + dir.Name, virtualPrepend + dir.Name + '/'); } }
private static void AddDirectoryTree(Iso9660Generator iso, string root, string virtualPrepend) { if(Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.Win32NT) root = root.Replace('/', '\\'); DirectoryInfo dirinfo = new DirectoryInfo(root); foreach (FileInfo file in dirinfo.GetFiles()) iso.AddFile(virtualPrepend + file.Name, file); foreach (DirectoryInfo dir in dirinfo.GetDirectories()) { iso.MkDir(virtualPrepend + dir.Name); AddDirectoryTree(iso, root + '/' + dir.Name, virtualPrepend + dir.Name + '/'); } }
static private void AddDirectoryTree(Iso9660Generator iso, string root, string virtualPrepend) { if (Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.Win32NT) { root = root.Replace('/', '\\'); } DirectoryInfo dirinfo = new DirectoryInfo(root); foreach (FileInfo file in dirinfo.GetFiles()) { iso.AddFile(virtualPrepend + file.Name, file); } foreach (DirectoryInfo dir in dirinfo.GetDirectories()) { iso.MkDir(virtualPrepend + dir.Name); AddDirectoryTree(iso, root + '/' + dir.Name, virtualPrepend + dir.Name + '/'); } }