Automatic login process to Windows Phone 7.1

In my Windows Phone application ( Silverlight application ), I want the user to automatically join the application after a successful login. Ie I do not want the user to log in every time.

I achieved this through the concept of an isolated storage file . I. First, I created a directory, and I created an isolated file system for the storage system and saved the email and password credentials in some file.
When I stopped debugging and started it back, my stream reader reads the email credentials from this file successfully.

My problem is , when I close the emulator and open it, I could not read from this file (in particular, the directory itself does not exist!). I also want to know my isolated storage is stored in a real Windows phone?

How can i fix this?

+2
source share
5 answers

This is by design.

Isolated storage in the emulator is not saved after it is closed.

Link: Windows Phone Emulator Scroll down to "Features":

Important Note:
Isolated storage is available while the emulator is running. Data in isolated storage does not persist after the emulator closes. This includes files stored in a local database, as these files reside in isolated storage.

+2
source

This is one feedback using the emulator - this is not a problem on a real phone.

See http://msdn.microsoft.com/en-us/library/ff402563%28v=vs.92%29.aspx

Important Note. Isolated storage is available while the emulator is running. Data in isolated storage is not saved after emulation is closed. This includes files stored in the local database, as these files are in isolated storage.

+2
source

There is nothing you can do about it. When you close and reopen the emulator, you delete all data (applications, isolated storage contents, lot) from the "device" and start again from the known state. One of the reasons for this is to allow the developer to switch to the โ€œwell-knownโ€ state of the device, so that every time you restart it, you can test from scratch.

If you want to save data between application launches, your only option is not to disable the emulator between runs.

+1
source

You can also use IsolatedStorageSettings.ApplicationSettings to store user credentials, and not to write a file:
http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragesettings.applicationsettings%28v=vs.95%29.aspx

And, as others have said, in the emulator, these settings are saved only when the emulator starts. note that you do not need to close the emulator between each debugging session. You can press the home button on the emulator to check the movement and exit of the application.

0
source

You can use the isolated storage tool of the explorer to take a snapshot of the isolated storage of applications (for example, with some default data), and then use this snapshot to restore the isolated content of the storage after restarting the emulator.

You can find additional information about ISETool and some "How to do" on How to use the article "Isolated Storage" in msdn.

0
source

Source: https://habr.com/ru/post/1396791/


All Articles