Windows Phone, how to import data (Isolatedstoragefile)?

Asked

Viewed 102 times

1

Is there any way I can import a data file (txt) into Windows Phone’s internal memory using "Isolatedstoragefile"? I need to import a list of customers, and be able to edit by the device.

1 answer

2


Isolated Storage is how we can record information from our Windows Phone applications on the device without having to use an SQL Server Compact database to do so.

This saves a lot of time that we would have to create a database structure and configure data access by our application but should not be used as a replacement for a database.

To use Isolated Storage reference is required.

using System.IO.IsolatedStorage;

To store data from our application just use as in the code snippet below:

IsolatedStorage iso = IsolatedStorage.ApplicationSettings;
if(!iso.Contains("LISTA_CLIENTES"))
{
     iso.Add("LISTA_CLIENTES", new List<string>());
}

To recover information just access by the key that was created:

List<string> list = new List<string>();
if(iso.Contains("LISTA_CLIENTES"))
{
     list = iso["LISTA_CLIENTES"];
}

To save information to an existing key:

List<string> list = new List<string>();if(iso.Contains("LISTA_CLIENTES")){     iso["LISTA_CLIENTES"] = list;}

SOURCE

  • Thanks for the answer, but that means there is no possibility to import data into the internal memory?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.