我正试图对孤立的储存进行检查,随后有一些指挥部也这样做。
What i wanted was to check for directories name consisting "a*" *If the directories exist* it will check if the diretory named after "a + today date" exist.
如果exist将显示的电文,该电文确实存在。
But if no directories consisting of "a*" is exist at all it will show a message of "Does not exist".
我的法典如下:
- Is able to check if the directories exist when there is a directory of "a*" is created.
- But it does not work *when none of the directories "a" is created**. How should i modify my code?
法典:
string[] fileNames;
string selectedFolderName;
private void gameBtn_Click(object sender, RoutedEventArgs e)
{
//MediaPlayer.Stop();
string currentDate = DateTime.Now.ToString("MMddyyyy");
string currentDateName = "a" + currentDate;
IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
fileNames = myStore.GetDirectoryNames("a*");
foreach (var name in fileNames)
{
if (fileNames.Contains(currentDateName))
{
selectedFolderName = currentDateName;
MessageBox.Show("Your schedule for today");
NavigationService.Navigate(new Uri("/DisplaySchedule.xaml?selectedFolderName=" + selectedFolderName, UriKind.Relative));
iii
else
{
MessageBox.Show("No Schdule for today", "Schedule Reminder", MessageBoxButton.OK);
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
iii
iii
iii
iii