1

I have a data file in f:\ drive named 'cd.txt'. I want to write this file to a CD i.e E:\.

String source ="F:\\cd.txt";
String destination="E:\\cd.txt";

File.copy(sorce,destination);

The above line is throwing exception saying:

"Access to the path 'E:\cd.txt' is denied"

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nitin
  • 11
  • 1
  • Is the .NET/C#? You can use ICDBurn to copy files to a disc. See this answer: [http://stackoverflow.com/questions/799867/write-to-a-cd-from-net](http://stackoverflow.com/questions/799867/write-to-a-cd-from-net) – leepowers Nov 19 '09 at 05:45

4 Answers4

1

I don't think that's so easily feasible, Windows explorer give the impression doing a file copy is enough but that not the case.

I think you might take a look at XPBurn component.

RageZ
  • 26,800
  • 12
  • 67
  • 76
0

You cant just copy files to a disc drive. Writing files to a CD-R is a complicated process.

I have heard of a C# .NET component called XPBurn. I have not used it, but it looks like it'll do what you need using the IMAPI Interfaces.

zfedoran
  • 2,986
  • 4
  • 22
  • 25
0

Yes, but it's technically Windows API:

Dhawan the One

John Weldon
  • 39,849
  • 11
  • 94
  • 127
0

IMAPI is only for C++, is there a good wrapper for C#? o maybe a library? i used the project wrapper from the codeproject page.. i haven't test it, all i did was exclude the Interop folder and moved it to another project to try and build the winform in WPF.. therefore i excluded the Interop to a single class project for a DLL... will test it this week..

Dabiddo
  • 341
  • 4
  • 5
  • 9