Q:

Change Location Folder?

I have just few days to show a demo about a Music Player in WPF and i have a trouble that i can not work out right now .
I need know how change a location folder meantime the Music Player is running ,i have 3 location folder:

D/: Morning;
D/: Afternoon;
D/: Night; 

in each folder there are songs of different genre.
 This music player will be used everyday from the  8am to 10pm with no stop ,so when run the application in morning(8am) it will download automatically the folder"Morning" but when the timeOfDay is Midday it will change location folder and so pass in the folder"Afternoon"(about 6p would pass to the folder "Night") and at the point i get stuck i don't know how work out this step,i don't know how organise my code to make the Music Player change location folder and download new songs in automatic way.
Please do you have some idea to illuminate my mind and go on to finish this Demo?
Sorry for my confusion;
Thanks a lot

A:

Honsa has the right idea, but this is a slightly cleaner implementation: 
public static string GetFolderForTime(DateTime time)
{
  if (time.Hour > 8 && time.Hour < 10)
    return @"D:\Morning\";
  if (time.Hour > 10 && time.Hour < 18)
    return @"D:\Afternoon\";
  return @"D:\Night\";
}

That way you can pass in a time different from the current one if you need to, although normally you would use DateTime.Now. 
Also, note that the name of the function describes what it does.

