Interface IStorage

Interface IStorage

Namespace: Aspose.Html.Dom
Assembly: Aspose.HTML.dll (25.2.0)

This interface of the Web Storage API provides access to a particular domain’s session or local storage. See Web Storage specification: https://html.spec.whatwg.org/multipage/webstorage.html#webstorage

[ComVisible(true)]
[DOMName("Storage")]
[DOMObject]
public interface IStorage

Properties

Length

Returns the number of key/value pairs.

[DOMName("length")]
long Length { get; }

Property Value

long

Methods

Clear()

Removes all key/value pairs, if there are any.

[DOMName("clear")]
void Clear()

GetItem(string)

Returns the current value associated with the given key, or null if the given key does not exist.

[DOMName("getItem")]
string GetItem(string key)

Parameters

key string

Item key string.

Returns

string

Item value string.

Key(long)

Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.

[DOMName("key")]
string Key(long n)

Parameters

n long

Number of storage item.

Returns

string

Key string.

RemoveItem(string)

Removes the key/value pair with the given key, if a key/value pair with the given key exists.

[DOMName("removeItem")]
void RemoveItem(string key)

Parameters

key string

Item key string.

SetItem(string, string)

Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.

[DOMName("setItem")]
void SetItem(string key, string value)

Parameters

key string

Item key string.

value string

Item value string.