Reputation: 23
I'm currently updating/upgrading my Silverlight project to the new runtime/universal apps.
Can someone please help me with isolated storage to local app data? I've had a look at msdn and other resources but I haven't been able to find a clear enough answer.
How can I save the text/data from a textbox in to the local app data? Here is parts of the Isolated Storage code :
Imports System.IO.IsolatedStorage
Dim highscoreISO As IsolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings
highscoreISO.Add("Highscore", ScoreLabel.Text)
Private Sub MainPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
If highscoreISO.Contains("Highscore") Then
HighScoreLabel.Text = "Highest Score: " & highscoreISO("Highscore").ToString
ScoreLabel.Text = highscoreISO("Highscore").ToString
Else
HighScoreLabel.Text = "Highest Score: 0"
End If
End Sub
Upvotes: 1
Views: 186
Reputation: 17617
Take a look at the Quickstart: Local app data It has code examples for both C# and VB.
If you want to continue working with files just get the StorageFolder object and then work with StorageFile objects. To get the app specific local folder do:
Dim localFolder As Windows.Storage.StorageFolder = Windows.Storage.ApplicationData.Current.LocalFolder
Upvotes: 2