I am writing a program that will constantly be reading information from a disc in the disc drive.
To accomplish this, I am using the following code.
if (Directory.Exists(@"D:\"))
{
DirectoryInfo LookingAtDir = new DirectoryInfo(@"D:\");
FileInfo[] Files = LookingAtDir.GetFiles("*.txt");
foreach (FileInfo IndividualFile in Files)
{
File.ReadAllBytes(IndividualFile.FullName);
File.ReadAllLines(IndividualFile.FullName);
File.ReadAllText(IndividualFile.FullName);
}
}
When I run my program, I don't notice my disc drive spinning.
Am I right to assume that my C# program isn't actually reading from the disc?
If so, any recommendations as to how I can achieve my goal?
Thanks.