Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6200017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:17:30+00:00 2026-05-24T04:17:30+00:00

I am trying to do a check on the isolated storage followed by some

  • 0

I am trying to do a check on the isolated storage followed by some command along with it.

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.

If it exist will show up a pop up message telling it does exist.

But if no directories consisting of “a*” is exist at all it will show a message of “Does not exist”.

Below is my code:

  • 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?

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));
            }
            else
            {
                MessageBox.Show("No Schdule for today", "Schedule Reminder", MessageBoxButton.OK);
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }
        }
    }

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:17:31+00:00Added an answer on May 24, 2026 at 4:17 am

    Your error is just a simple typo.

    if (fileNames.Contains(currentDateName))
    

    should be

    if (name.Contains(currentDateName))
    

    As for handling when there’s no directory “a*”, check if fileNames is empty.

    if (fileNames.Length == 0) // no Directory 'a' was found, create it
    {
         // create code here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to check if a name is already stored in the database from the
I am trying to check some settings in the general web.config.comments file, located in
I am trying to check for new orders in Magento and if they exist,
I'm trying to check a value on some activities calls. This is what I'm
Can some on help me out here? I am trying check each directory entry
I am just trying to check whether compiler allows type name as variable name.
I am trying to check a series of buttons to see if they have
I'm trying to check if a file exists. If I use this: NSData *data
I am trying to check the following and all throw an out of bounds
I'm trying to check a checkbox, i've tried doing the following :- $('#someId').attr('checked','checked'); $('#someId').attr('checked',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.