The IWebStorage interface of the Web Storage API provides access to the session storage or local storage for a particular document on the loaded web page, allowing you to for example add, modify or delete stored data items.
More...
|
string | Key (long index) |
| Returns the name of the key in the storage. The order of keys is user-agent defined, so you should not rely on it. More...
|
|
bool | Set (string key, string value) |
| Adds the key and value to the storage, or updates key's value if it already exists. More...
|
|
bool | Remove (string key) |
| Removes the element with the specified key from the storage. More...
|
|
bool | Clear () |
| Removes all key/value pairs in the storage. More...
|
|
bool | Contains (string key) |
| Returns true if storage contains specified key or false otherwise. More...
|
|
|
long | Count [get] |
| Gets number of key/value pairs in the storage. Returns 0 if the storage hasn't been initialized yet or has no key/value pairs. More...
|
|
string | this[string key] [get] |
| Gets the value associated with the given key or null when the key doesn't exist. More...
|
|
The IWebStorage interface of the Web Storage API provides access to the session storage or local storage for a particular document on the loaded web page, allowing you to for example add, modify or delete stored data items.
bool DotNetBrowser.IWebStorage.Clear |
( |
| ) |
|
Removes all key/value pairs in the storage.
- Returns
- true if storage was successfully cleared. Returns false in case of exceptions or storage was not initialized.
bool DotNetBrowser.IWebStorage.Contains |
( |
string |
key | ) |
|
Returns true if storage contains specified key or false otherwise.
- Parameters
-
key | the name of the key you want to check. Cannot be null. |
- Returns
- true if storage contains specified key or false otherwise.
- Exceptions
-
ArgumentNullException | when the key is null. |
string DotNetBrowser.IWebStorage.Key |
( |
long |
index | ) |
|
Returns the name of the key in the storage. The order of keys is user-agent defined, so you should not rely on it.
- Parameters
-
index | an integer representing the number of the key you want to get the name of. This is a zero-based index. Must be in the range greater than 0 and less than the Count. |
- Returns
- a string containing the name of the key or null.
- Exceptions
-
ArgumentOutOfRangeException | when the index isn't in the range greater than 0 and less than the Count. |
bool DotNetBrowser.IWebStorage.Remove |
( |
string |
key | ) |
|
Removes the element with the specified key from the storage.
- Parameters
-
key | key the name of the key you want to remove. Cannot be null. |
- Returns
- true if key/value pair was successfully removed, or key doesn't exist. Returns false in case of exceptions.
- Exceptions
-
ArgumentNullException | when the key is null. |
bool DotNetBrowser.IWebStorage.Set |
( |
string |
key, |
|
|
string |
value |
|
) |
| |
Adds the key and value to the storage, or updates key's value if it already exists.
- Parameters
-
key | the name of the key you want to create. Cannot be null. |
value | the value you want to give the key you are creating. Cannot be null. |
- Returns
- true if key/value pair was successfully added or updated. Returns false in case of exceptions.
- Exceptions
-
ArgumentNullException | when the key or value is null. |
long DotNetBrowser.IWebStorage.Count |
|
get |
Gets number of key/value pairs in the storage. Returns 0 if the storage hasn't been initialized yet or has no key/value pairs.
string DotNetBrowser.IWebStorage.this[string key] |
|
get |
Gets the value associated with the given key or null when the key doesn't exist.
- Parameters
-
key | the name of the key you want to retrieve the value of. Cannot be null. |
- Returns
- The element with the specified key.
- Exceptions
-
ArgumentNullException | when the key is null. |