I have this code, C#, to write a file to a dvd. I quite new to the
NERO SDK (not to c# though) and the code doens't work. It ejects the DVD and gives the statuscode user-abort. Any help is appreciated. Thanks in advance.
Code:
private void Burn_Click(object sender, EventArgs e)
{
try {
NeroISOTrackClass NeroISO = new NeroISOTrackClass();
NeroISO.Name = "TEST-DVD";
NeroFolderClass NeroFolder = new NeroFolderClass();
NeroISO.RootFolder = NeroFolder;
NeroFileClass NeroFile = new NeroFileClass();
NeroFile.Name = "log.txt";
NeroFolder.Files.Add(NeroFile);
NeroISO.BurnOptions = NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_ISO_FS;
Drive = (NeroDrive)Drives.Item(BurnerList.SelectedIndex);
Drive.OnProgress += new _INeroDriveEvents_OnProgressEventHandler(OnProgress);
Drive.OnDoneBurn += new _INeroDriveEvents_OnDoneBurnEventHandler(Drive_OnDoneBurn);
Drive.BurnIsoAudioCD("", "", false, NeroISO, null, null,
NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE, 10, NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY);
}
catch(Exception ex) {
MessageBox.Show(ex.Message);
}
}
void Drive_OnDoneBurn(ref NERO_BURN_ERROR StatusCode)
{
MessageBox.Show(StatusCode.ToString());
}
private void OnProgress(ref int Percentage, ref bool Done)
{
Progress.Value = Percentage;
}