Adds an entry to the dictionary for the key-value pair.
Namespace:
System.IO.IsolatedStorage
Assembly:
System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
Public Sub Add ( _
key As String, _
value As Object _
)
Dim instance As IsolatedStorageSettings
Dim key As String
Dim value As Object
instance.Add(key, value)
public void Add(
string key,
Object value
)
Implements
IDictionary<(Of <(TKey, TValue>)>)..::.Add(TKey, TValue)
Use this method to add key-value pairs to isolated storage.
The following example tries to add a key-value pair for the user's name to the settings dictionary. If the data is added successfully, a confirmation is displayed in a TextBox named tbResults. If the key already exists, an exception message is displayed. This example is part of a larger example for the IsolatedStorageSettings class.
Try
userSettings.Add("name", tbName.Text)
tbResults.Text = "Name saved. Refresh page to see changes."
Catch ex As ArgumentException
tbResults.Text = ex.Message
End Try
try
{
userSettings.Add("name", tbName.Text);
tbResults.Text = "Name saved. Refresh page to see changes.";
}
catch (ArgumentException ex)
{
tbResults.Text = ex.Message;
}
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Reference
Other Resources