I'm a newbie in C#
I have this Code
FileStream D = new FileStream("C:/PersonalAssistant/RecentMeetingDetails.txt", FileMode.Open, FileAccess.Read);
StreamReader DR = new StreamReader(D);
DR.BaseStream.Seek(0, SeekOrigin.Begin);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ALERT! ALERT!! ALERT!!!");
Console.WriteLine("\nYour Closest Appointment is on " + rd + " and has the following info");
string data = DR.ReadLine();
while (data != null)
{
Console.WriteLine(data);
data = DR.ReadLine();
}
D.Close();
DR.Close();
I want this code
Console.WriteLine("ALERT! ALERT!! ALERT!!!");
to be blinking while the other details are being read from the file and displayed on the screen
I have tried this
private static void WriteBlinkingText(string text, int delay)
{
bool visible = true;
while (true)
{
Console.Write("\r" + (visible ? text : new String(' ', text.Length)));
System.Threading.Thread.Sleep(delay);
visible = !visible;
}
}
and change th console.writeline to
WriteBlinkingText("ALERT! ALERT!! ALERT!!!",500);
it worked but the other details were not displayed...
Pls help me correct this code