什麼是基於來自C#中的文件夾結構.ISO文件的最佳方式?是否有除DiscUtils以外的開源庫?運行到問題與DiscUtils,我想嘗試另一種路徑。我有什麼選擇?我更喜歡開源,但也可能願意爲解決方案付費。DVD ISO從C# - .NET DiscUtils替代
4
A
回答
4
這裏有一些更多的嘗試
2
你可以嘗試普里莫刻錄機(音頻CD不支持):http://www.primoburner.com/Downloads.aspx
5
Windows實際上附帶使用本地API創建ISO等等:Image Mastering API。一旦從Windows SDK獲取IMAPI2 Interop程序集或從this CodeProject article about IMAPI2(可能更容易),創建ISO只是幾行代碼。
不幸的是,你還需要幾段妥善清理所涉及的COM廢話,但最終的結果還是蠻管理:
MsftFileSystemImage iso = new MsftFileSystemImage();
iso.ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE.IMAPI_MEDIA_TYPE_DISK);
iso.FileSystemsToCreate = FsiFileSystems.FsiFileSystemISO9660 | FsiFileSystems.FsiFileSystemJoliet;
iso.Root.AddTree(@"c:\path\goes\here\", false);
dynamic resultImage = iso.CreateResultImage();
dynamic imageStream = resultImage.ImageStream;
IStream newStream = null;
if (imageStream != null)
{
STATSTG stat = null;
imageStream.Stat(stat, 0x1);
int res = SHCreateStreamOnFile(@"c:\path\to\your.iso", 0x1001, newStream);
if (res == 0 && newStream != null)
{
IntPtr inBytes = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(long)));
IntPtr outBytes = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(long)));
try
{
imageStream.CopyTo(newStream, stat.cbSize, inBytes, outBytes);
}
finally
{
Marshal.FinalReleaseComObject(imageStream);
newStream.Commit(0);
Marshal.FinalReleaseComObject(newStream);
Marshal.FreeHGlobal(inBytes);
Marshal.FreeHGlobal(outBytes);
Marshal.FinalReleaseComObject(resultImage);
Marshal.FinalReleaseComObject(iso);
}
}
else
{
Marshal.FinalReleaseComObject(imageStream);
Marshal.FinalReleaseComObject(resultImage);
Marshal.FinalReleaseComObject(iso);
//TODO: Throw exception or do whatever to signal failure here
}
}
else
{
Marshal.FinalReleaseComObject(resultImage);
Marshal.FinalReleaseComObject(iso);
//TODO: Throw exception or do whatever to signal failure here
}
詳細爲Win32/COM API膠的使用可以唯一位SHCreateStreamOnFile:上pinvoke.net找到。 istream和STATSTG是System.Runtime.InteropServices.ComTypes.。
相關問題
- 1. 使用.NET創建CD/DVD ISO映像
- 2. 自動刻錄100+ .ISO DVD映像
- 3. ZooKeeper替代.net
- 4. 替代在.NET
- 5. .NET替代
- 6. .NET/WPF替代
- 7. 在ISO C89中strcpy的替代方案
- 8. 從.ISO Windows安裝
- 9. C++中的ISO文件
- 10. .NET WebClient.DownloadData(url)在C++/WinAPI中的替代?
- 11. ISO C++編譯錯誤的C代碼
- 12. 從java代碼到.net(c#)
- 13. 與從C#的.NET代碼
- 14. 如何從C#刻錄視頻DVD?
- 15. .Net MVC替代Formtastic
- 16. DVD + R可以保存.iso文件並通過BIOS啓動?
- 17. Windows 7旗艦版ISO - DVD或閃存驅動器?
- 18. PHP在本地服務器上顯示ISO DVD映像
- 19. 從c到C++的替代方法
- 20. 使用C播放DVD#
- 21. Cocoa中是否有框架來創建和操作ISO磁盤映像?
- 22. .NET 4.0替代.NET 4.5命名空間
- 23. 從ISO C時間戳轉換爲整形時代在PHP
- 24. 替代.NET的Uri實現?
- 25. .NET 2/VB:RequestValidation =假替代
- 26. .NET WinForms ToolStrip替代方案
- 27. 是否有.Net替代GetAsyncKeyState?
- 28. .net替代玻璃魚
- 29. 替代.NET的客戶端
- 30. 從3個lettor ISO代碼(ISO 3166-1 alpha-3)獲取MS地理標識
使用** ** DiscUtils對當前項目的要求......是你有什麼確切的問題考慮? – SliverNinja 2014-09-04 14:52:26