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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:55:32+00:00 2026-05-24T06:55:32+00:00

I want to save text from a textbox to the internalStorage and load it

  • 0

I want to save text from a textbox to the internalStorage and load it from there…

The saving-part works fine. But the loading won’t work I tried many tutorials already.

private void button2_Click(object sender, RoutedEventArgs e)
    {
        //get selected FileName from listBox
        string selItem = listBox1.SelectedItem.ToString();
        IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
        if (selItem != null)
        {
           IsolatedStorageFileStream fileStream = store.OpenFile(selItem, FileMode.Open, FileAccess.Read);
            using (StreamReader sr = new StreamReader(fileStream))
            {
                String line = "";
                //Debug.WriteLine("ReadLine");
                if ((line = sr.ReadLine()) != null)
                {
                    //Debug.WriteLine("ReadLineText");
                    textBox1.Text = line;
                }
                sr.Close();
            }
            fileStream.Close();
        }
    }

Instead of:

if ((line = sr.ReadLine()) != null)
            {
                //Debug.WriteLine("ReadLineText");
                textBox1.Text = line;

I’ve tried many possibilities like: textBox1.Text = sr.ReadLine(); and so on..

The curious thing about he code is: If I enter for example:

IsolatedStorageFileStream fileStream = store.OpenFile("text0.txt", FileMode.Open, FileAccess.Read);

It works fine for the single file text0.txt.

Would be really really great if someone give me some tips to fix the code.

Thanks in advance..

  • 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-24T06:55:33+00:00Added an answer on May 24, 2026 at 6:55 am

    this is how I open an ISF Stream

    IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
    IsolatedStorageFileStream stream = new IsolatedStorageFileStream(filename, FileMode.OpenOrCreate, isf);  // loads from isolated storage
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to save and load my xml data using XmlReader. But I don't
I want to be able to save a bitmap image with text from a
I want to save html-formatted text to database, but when I do that it
I want to save a matrix to a text file, so I can read
I want to save large amounts of text then display them (first in table
I want to use Ckeditor for Entering text and I want to save that
I want to save and store simple mail objects via serializing, but I get
is it possible to get any information/text from JQuery Alert or a simple textbox
I want to save the objects I generated in a program. After restart the
I want to save history of changes, so in @PostUpdate i want to create

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.