共用方式為


Burn CDs right from your .NET code...

Anson Horton gave me this cool .NET component and source code last night so I've uploaded it to microsoft.com for your burning fun

The XPBurnComponent allows your .NET applications to burn files to CDR/W discs on a Window XP® or Windows 2003 Server system. This component does not work for systems which have a different OS installed; though it will detect that case and give a reasonable error message. This component talks directly to the system’s IMAPI interfaces and doesn’t use the Windows XP CD burning wizard, so it’s possible to create your own snazzy UI for burning CDs.

Though the component is a UserControl, I wouldn’t recommend that you put it in the toolbox. Instead, simply reference it and use it like you would use any other framework type (the constructor can potentially throw exceptions, so for robust handling you should wrap it in a try…catch). The documentation and source for the component is included in the download.

You can download the component, developer documentation, and source from here. Send any feedback, comments, or bug reports to ansonh@microsoft.com.

In a few hours it should be happily living at msdn.microsoft.com/vcsharp/team/code/xpburn/default.aspx (future home of samples and any ongoing updates) but the download on its own is available now from download.microsoft.com/download/6/9/c/69c5d1b7-e3ac-4986-99f1-0c55dc374d66/xpburn.msi

Comments

  • Anonymous
    November 18, 2003
    Great!

    BTW: Don't you all hate those .msi files?
  • Anonymous
    January 04, 2004
    this is verry cool

  • Anonymous
    January 04, 2004
    Hello!, give me a ex.. ?
  • Anonymous
    January 15, 2004
    When will the code be updated to support naming of cd's?

  • Anonymous
    February 29, 2004
    The comment has been removed
  • Anonymous
    March 09, 2004
    Trying to burn without a CD inserted throws an exception from a thread (when calling SetActiveDiscRecorder). Trying to burn more than one file from the same directory does the same (when calling CreateStorageDirectory).
  • Anonymous
    April 15, 2004
    this website is ausom
  • Anonymous
    April 30, 2004
    Has anyone played with the XPBurn tools Event Notification? I keep getting signatures don't match errors.
  • Anonymous
    May 03, 2004
    sweet





  • Anonymous
    May 03, 2004
    sweet





  • Anonymous
    May 13, 2004
    The comment has been removed
  • Anonymous
    May 24, 2004
    Dan,

    In reply to your message 3/9/2004 8:51 AM:

    "Trying to burn without a CD inserted throws an exception from a thread (when calling SetActiveDiscRecorder)."

    -- There are properties such as isWritable, isUsable, isReadable, etc, that you can use to determine if there not only is a cd in the drive but if it is usable.

    "Trying to burn more than one file from the same directory does the same (when calling CreateStorageDirectory)."

    -- Although the documentation says otherwise, you must specify the path to the "nameoncd". Otherwise you are correct you can only burn one file from any source folder. You must specify the full path for both the "filename" and "nameoncd" and it works. Checking the source code, this is pretty redundant becuase the first thing the code does with the path you specify for the "nameoncd" is remove the path.

  • Anonymous
    May 24, 2004
    Pherat,

    In reply to your message 2/29/2004 4:18 PM:

    "
    //Add file you want to burn, and Name of Cd
    XPB.AddFile(@"somthing.txt","MYCDName")
    "

    -- should be XPB.AddFile(@"c:somthing.txt", (@"c:somthing.txt")

    "
    /Burn CD Parameter1=simultate or burn - type true to burn
    Parameter2=Eject Cd after burn..type true to eject Cd
    /
    XPB.RecordDisk(true,true);
    "

    -- the first parameter is simulation, so to burn you sould put false.
  • Anonymous
    May 24, 2004
    oops, how did that ( get in there...

    XPB.AddFile(@"c:somthing.txt", @"c:somthing.txt");
  • Anonymous
    May 24, 2004
    Hello.
    Thank you very much for this seemingly great library. (Haven't tested it yet)
  • Anonymous
    May 24, 2004
    The comment has been removed
  • Anonymous
    May 25, 2004
    The comment has been removed
  • Anonymous
    May 25, 2004
    Any VB.NET sample, even short is welcome...
  • Anonymous
    June 09, 2004
    this is an awesome place to burn cd's
  • Anonymous
    June 09, 2004
    you guys are great.
  • Anonymous
    June 12, 2004
    im glad that you can do stuff like this
  • Anonymous
    June 12, 2004
    im glad that you can do stuff like this
  • Anonymous
    June 22, 2004
    My question is how can I burn multiple sessions with XPburn.
    Thanks!
  • Anonymous
    June 22, 2004
    This dll calls the IDiscMaster::SetActiveDiscRecorder method that doesn't work on my PC.
    SetActiveDiscRecorder always returns the exception HRESULT:0x80040225 (IMAPI_E_StashInUse).
    MSDN says that SetActiveDiscRecorder relies on exclusive access to MSDiscStashObj but I don't how to do that.
    I would be interested if anyone has had similar problems, or knows any solutions.

    Thanks
  • Anonymous
    June 23, 2004
    The comment has been removed
  • Anonymous
    June 28, 2004
    THANK YOU
  • Anonymous
    June 28, 2004
    The comment has been removed
  • Anonymous
    June 28, 2004
    If anyone's interested, short article on how to use this example library to write Audio discs from WAV: http://www.sichbo.ca/DotNetCode/1201
  • Anonymous
    June 30, 2004
    How can I modify the source code so that when the burning process is finished, to delete the files that I have burned from my hard disk?
  • Anonymous
    June 30, 2004
    "I plan to release an update this weekend, and this is one of the problems I intend to fix"

    Did the new version get released yet?
  • Anonymous
    July 01, 2004
    The comment has been removed
  • Anonymous
    July 04, 2004
    Great place for IMAPI stuff. Has anyone tried using events and event handlers? It would be helpful if someone posts a sample which trps event notifications from IMAPI and shows the progress of the write.
  • Anonymous
    July 06, 2004
    I am able to successfully burn the files to the CD. But after a few cycles, I have started seeing COMException 0x8004021C - IMPAI_E_DISCFULL. Physically I can see that there is enough space for the next burn. But it keeps throwing this error. Even when tried to copy the files to the CD from the Windows explorer, I see the same error. Is anyone experiencing similar problem after a few files are burnt?
  • Anonymous
    July 23, 2004
    heyi want to burn some cds
  • Anonymous
    July 25, 2004
    cool
  • Anonymous
    July 28, 2004
    From 6/23...

    "I plan to release an update this weekend, and this is one of the problems I intend to fix."

    Has this been/going to be released? The imapi.exe process isn't getting terminated and is causing problems.
  • Anonymous
    July 29, 2004
    The comment has been removed
  • Anonymous
    August 04, 2004
    How can make use of this dll from ASP.net page such that it detect client's CD R/W drive and burns the file that the client gives from his hard drive? Any pointers would be appreaciated.

    -Vinoth