how to burn the files selected from listview in a dvd using c#.net code?

1.2k views Asked by At

can any expert help me out to solve a problem of burning a dvd using c#.net as a front end?? i need to select files from the listview in winform and then on button click i need to burn those multiple files in the dvd.. the concept is to select the multiple files from listview then on button click it should make a folder in some desired drive.. and then it should burn that complete folder in the dvd..this whole process should be performed during a single button click.... is there any way out?? the code should be compatible to use in .net2008 and windowsXP are the given codes compatible??

im using the componenet to get the dll/class lib. from (msdn.microsoft.com/en-au/vcsharp/aa336741.aspx) but its giving me error message "there are no components in d:\filepath\burncomponent.dll to be placed on the toolbox

   private void button1_Click(object sender, EventArgs e)
    {
        XPBurnCD cd = new XPBurnCD();
        cd.BurnComplete += new NotifyCompletionStatus(BurnComplete);

        MessageBox.Show(cd.BurnerDrive);

        DirectoryInfo dir = new DirectoryInfo(_burnFolder);
        foreach (FileInfo file in dir.GetFiles())
        {
            cd.AddFile(file.FullName, file.Name);
        }

        cd.RecordDisc(false, false);


    }

    private void BurnComplete(uint status)
    {
        MessageBox.Show("Finished writing files to disc");
    }

    private void button2_Click_1(object sender, EventArgs e)
    {

        FolderBrowserDialog fbd = new FolderBrowserDialog();
        fbd.ShowNewFolderButton = false;
        fbd.Description = "Please select a folder";
        fbd.RootFolder = System.Environment.SpecialFolder.DesktopDirectory;

        if (fbd.ShowDialog() == DialogResult.OK)
        {
            _burnFolder = fbd.SelectedPath;
        }
        else
        {
            _burnFolder = string.Empty;
        }
    }
2

There are 2 answers

19
AudioBubble On BEST ANSWER
1
Oliver On

One simple approach could be to use the command line tools dvdburn and cdburn, which are belonging to XP. For example take a look at this site.

Update

Yes, it is a console application, but you can start it within a .Net Application by using the Process class. And here you should especially take a deeper look into the StartInfo property and its members, cause here you can set the parameters or redirect the output into your program to get informations about what the program is doing.