Storage Class
A storage area of Web Storage (https://html.spec.whatwg.org/multipage/webstorage.html#the-storage-interface): window.localStorage or window.sessionStorage. Its items are the items of the storage area of the origin of the document, shared by the documents of the same origin (and, for the session storage, of the same top-level browsing context).
public sealed class StorageProperties
| Name | Description |
|---|---|
| Length | Gets the number of items (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-length). |
Length
Storage.csGets the number of items (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-length).
public uint Length { get; }Methods
| Name | Description |
|---|---|
| Clear() | Removes all the items (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-clear). |
| GetItem(string) | Returns the value of a key, or null (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-getitem). |
| Key(uint) | Returns the key at an index, or null (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-key). |
| RemoveItem(string) | Removes a key (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-removeitem). |
| SetItem(string, string) | Sets the value of a key (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-setitem), and fires a storage event at the other windows that use the storage area. Throws a QuotaExceededError when the quota of the storage area is exceeded. |
Clear()
Storage.csRemoves all the items (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-clear).
public void Clear()GetItem(string)
Storage.csReturns the value of a key, or null (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-getitem).
Key(uint)
Storage.csReturns the key at an index, or null (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-key).
RemoveItem(string)
Storage.csRemoves a key (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-removeitem).
SetItem(string, string)
Storage.csSets the value of a key (https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-setitem), and fires a storage event at the other windows that use the storage area. Throws a QuotaExceededError when the quota of the storage area is exceeded.