copy files to a CD

Posted on 2010-01-05
Last Modified: 2012-06-27
In my winform app. I need to copy some files to a CD without burning them.
 I use file.copy(fileToCopy,@"D:\") and got an IO exeption error.
How can I sove this issue?
Question by:yaron89
    LVL 3

    Expert Comment

    on what position are you recieving the IO Exception? on the Read or the Write.

    you cant just write files to the CDROM, in order to Write them you need todo something like XPBurn Application, you need to burn them, meaning you can build an application that stores the location of the files and uppon burn command burns them from the location to the CD
    LVL 8

    Expert Comment

    CD file system is different. Look for CDFS APIs

    Author Comment

    I don't want to burn the files. I would like to add them to the list of files that waiting to be burn on the CD.  
    LVL 3

    Accepted Solution

    try using the CD IMAPI.

    here is a sample

    ignore the Burn Part until you want to execure the Burn procedure, this should do the trick

    Author Closing Comment

    Thank You
    LVL 29

    Expert Comment

    Just to add to the question


    If you have recording enabled it maps to CSIDL_CDBURN_AREA a temporary location until your ready to burn. You can directly write to this location instead of trying to write to a read only device.

    Ex. C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\CD Burning

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity mvc C# 2 27
    network + 7 60
    Aspnet xml 2 27
    Please explain "Promise Pattern" and how it's used 2 23
    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now