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 6151657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:48:01+00:00 2026-05-23T19:48:01+00:00

I m trying to retrieve all the data in the isolated storage file. But

  • 0

I m trying to retrieve all the data in the isolated storage file.
But i get a index out of range error.
home^how^yo^

StreamReader readFile = new StreamReader(new IsolatedStorageFileStream("AlarmFolder\\alarm.txt", FileMode.Open, myStore));

string[] alarmDetailsSeparated;

String fileText = readFile.ReadLine();


//alarmDetailsSeparated is the array that hold the retrieved alarm details from alarm.txt and is split by '^'
alarmDetailsSeparated = fileText.Split(new char[] { '^' });

foreach (string home in alarmDetailsSeparated)
{
    for (i = 0; i < alarmDetailsSeparated.Length;)
    {
        if (test > 0)
        {
            i = test;
        }

        dateSeparate = alarmDetailsSeparated[i];
        timeSeparate = alarmDetailsSeparated[i + 1];
        labelSeparate = alarmDetailsSeparated[i + 2];

        date = dateSeparate;
        time = timeSeparate;
        label = labelSeparate;

        test = test + 3 ;
        break;
    }

    MessageBox.Show("i is " + alarmDetailsSeparated[i]);
    MessageBox.Show("i + 1 is " + alarmDetailsSeparated[i + 1]);
    MessageBox.Show("i + 2 is " + alarmDetailsSeparated[i + 2]);
}
  • 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-23T19:48:02+00:00Added an answer on May 23, 2026 at 7:48 pm

    Ok, IIUC your storage file looks something like this:

    home^date^time^label
    home^date^time^label
    ...
    

    and you want to do processing on each alarm data entry in the file.

    The first thing you need to do is split it on each line:

    string[] lines = file.ReadAllLines("alarms.dat");
    foreach (line in lines) {
        // handle the alarm data entry (see below)
    }
    

    Now you can do the split as you are doing in your code:

    string[] data = line.Split(new char[] { '^' });
    

    This should give you 4 entries if the line has the data you want, so check for this:

    if (data.Length == 4) { // looks like an alarm data entry
        // do processing on the alarm data entry (see below)
    }
    

    the data can now be extracted:

    string home = data[0];
    string date = data[1];
    string time = date[2];
    string label = date[3];
    

    And then acted on:

    MessageBox.Show(String.Format("home {0} at {1} on date {2} with label {3}",
                    home, time, date, label));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to retrieve data from mysql database into stylesheet.php but it is not
I am trying to retrieve particular data from a txt file and would like
I'm trying to write a reusable function to retrieve all data in a table
I am trying to get this week's data in sqlite but it seems that
I'm trying to retrieve all the data id from a database where their tags(array)
I am trying to retrieve Tiff image data through COM using a StringBuilder but
I'm trying to group and still retrieve all the data in the table. I'm
I'm trying to retrieve all documents in a folder in google docs using the
I'm trying to build a script to retrieve all feed entries from a given
I am trying to write an SQL query to retrieve all of a users

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.