Monday, September 10, 2007

a good site for C#.Net

I have found out one very nice web site to start off with C# .Net. Those who are willing to learn the basics of C# .Net, this site would help you a lot.
Check it out
http://www.functionx.com/vcsharp/Lesson01.htm

Tuesday, September 4, 2007

Reading CD Rom in C# .NEt

One of my friends had a trouble in Reading data from the CD. Here is a simple solution which i found out.
In this code, we first find out the Logical Drives which are read only. Once we get all read only drives. We can find out the files from CD which is in CD rom. (Not sure whether it will work with CD Writers).But here is the code, u can use ths code for some other thing. And if u have any other solution for this,you are welcome.

private void ReadData(object sender, EventArgs e)
{

string[] drivesPathTab=Directory.GetLogicalDrives();
for (int i = 0; i < drivesPathTab.Length; i++)
{
DirectoryInfo dirInfo = new DirectoryInfo(drivesPathTab[i]);
if ((dirInfo.Attributes & FileAttributes.ReadOnly) != 0)
{
// if code enters in this block, then drive is Read only
// Check for the file on the drive, If it exists, continue.
}
}

}