问题
I am writing a program that downloads images to the hard drive and then I want to burn the folders that those are all divided up into, on a cd. I don't want to create and image to burn, I just want to take all those folders and files and burn them to disc just like they are on the hard drive. Anyone know of a way to do this in C#?
I am using Windows 7 and Visual Studio 2008.
回答1:
IMAPI2 - version 2 of the IMAPI API - is native to Windows 7 and is the preferred interface.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366457(v=vs.85).aspx
回答2:
There is no way to do this without calling API calls in to windows. It appears to be done with COM calls(ICDBurn for XP, MAPI for Windows Vista or newer). Here is a SO Question that can point you in the right direction in how to do it in C++.
If you need assistance doing COM calls in C# feel free to open a new question on the issue you are having with that.
回答3:
As of Windows Vista you can use the IMAPI API. This API enables you to burn images to CD, DVD and Blu-ray.
More information about the Image Master API can of course be found on MSDN:
http://msdn.microsoft.com/en-us/library/aa366450(v=VS.85).aspx
Check out this CodeProject article which talks in detail about it:
Another third party library that can help is SharpRecorder. The code is hosted on Google. Take a look at is to see if it fits your requirements. If not, you can always access the code and see how it works and learn from it.
回答4:
There is a couple of ways to do this with C# and IMAP2 Here is an example on Code Project
Also there is another example here using c#
note: if you are doing this on 7 you will need this update
来源:https://stackoverflow.com/questions/11194299/burn-files-to-cd-using-c-sharp