TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nihal Ahmed
1.6k
96
20.5k
Working With Disc Brunning Using IMapi.
Feb 11 2014 2:35 AM
ello all,
I am on a stage where i need to write a folder in disc and add some files in that folder from my local drive and so on,
it is ok to make a folder in disc even ok to write files in disc as bulk data But i am having problem in writing data in perticular Directory in Disc,
Here is the Code
[CODE]
public void BurnDirectory(IDiscRecorder2 recorder, List<String> Images, List<String> Videos,String DiscLabel)
{
try
{
IDiscFormat2Data dataWriterImage = new MsftDiscFormat2Data();
dataWriterImage.Recorder = recorder;
if (!dataWriterImage.IsRecorderSupported(recorder))
{
Console.WriteLine("The recorder is not supported");
return;
}
if (!dataWriterImage.IsCurrentMediaSupported(recorder))
{
Console.WriteLine("The current media is not supported");
return;
}
dataWriterImage.ClientName = "My Disc";
IFileSystemImage fsi = new MsftFileSystemImage();
// Set the media size
fsi.FreeMediaBlocks = dataWriterImage.FreeSectorsOnMedia;
if (DiscLabel != "")
{
fsi.VolumeName = DiscLabel;
}
fsi.FileSystemsToCreate = FsiFileSystems.FsiFileSystemISO9660;
IFsiDirectoryItem ImageDir = fsi.Root;
Boolean Flag = true;
for (int i = 0; i < Images.Count; i++)
{
if (Flag)
{
//ImageDir = fsi.CreateDirectoryItem("Images");
ImageDir.AddDirectory("Images");
//ImageDir.AddDirectory("Images");
Flag = false;
}
ImageDir.AddTree(Images[i], false);
}
IFsiDirectoryItem VideoDir = fsi.Root;
Flag = true;
for (int i = 0; i < Videos.Count; i++)
{
if (Flag)
{
VideoDir.AddDirectory("Videos");
Flag = false;
}
VideoDir.AddTree(Videos[i], false);
}
IFileSystemImageResult result = fsi.CreateResultImage();
IStream stream = result.ImageStream;
DiscFormat2Data_Events progress = dataWriterImage as DiscFormat2Data_Events;
progress.Update += new DiscFormat2Data_EventsHandler(DiscFormat2Data_ProgressUpdate);
dataWriterImage.ForceOverwrite = true;
dataWriterImage.Write(stream); // Burn the stream to disc
progress.Update -= new DiscFormat2Data_EventsHandler(DiscFormat2Data_ProgressUpdate);
}
catch (Exception ex)
{
throw (ex);
}
}
[/CODE]
In short, I need to add some folder lets say images and add some files in it.
Please Help me
Reply
Answers (
0
)
Gauge meter in winform
retrieve data from combobox in selectedindexchanged problem