Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Burn files to CD using c#

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.

like image 787
Bryan Avatar asked Jun 25 '12 17:06

Bryan


People also ask

How do I copy files to a CD in Windows 10?

Browse any files you would like to add to the disc, then click Start > File Explorer > This PC and open the drive containing your DVD-R or CD-R. Then drag and drop any files you want to write to the disc. When complete, click the Manage tab and then Eject.


2 Answers

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

like image 97
ScottTx Avatar answered Oct 27 '22 08:10

ScottTx


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.

like image 20
Scott Chamberlain Avatar answered Oct 27 '22 10:10

Scott Chamberlain