Hi
I have ben trying to figure out how to sort a array by date, all the examples i have found so far, i have had a hard time making any sence of. I got a tab seperated txt file, with the following data.
Date - Meeting - Duration
what i am doing is i am loading some meetings from a text file, and then putting that on top of a picture and saving that as a new picture. I am trying to create a screen, that shows if a meeting room is in use or not.
and my code:
Image img = pictureBox1.Image;
Graphics graphic = Graphics.FromImage(img);
TextReader sr = new StreamReader(@"C:/Temp/Kalender.txt", Encoding.GetEncoding("iso-8859-1"));
string besked = " EMPTY"; //txt
graphic.DrawString(DateTime.Today.ToString("dd/MM/yyyy") + besked, new Font("Arial", 26), new SolidBrush(Color.Black), new PointF(5.0f, 5.0f));
string contents = sr.ReadToEnd();
string[] myArray = { contents };
Array.Sort(myArray);
foreach (string kalenderdata in myArray)
{
// graphic.DrawString( gotya);
graphic.DrawString(kalenderdata, new Font("Arial", 18), new SolidBrush(Color.White), new PointF(5.0f, 35.0f));
}