共用方式為


ProtectedLocalStorage 類別

定義

提供在瀏覽器的 'localStorage' 集合中儲存和擷取資料的機制。

此資料的範圍會限定為目前使用者的瀏覽器,且會跨所有索引標籤共用。 資料會在瀏覽器重新開機時保存。

請參閱:https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

public ref class ProtectedLocalStorage sealed : Microsoft::AspNetCore::Components::Server::ProtectedBrowserStorage::ProtectedBrowserStorage
public sealed class ProtectedLocalStorage : Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.ProtectedBrowserStorage
type ProtectedLocalStorage = class
    inherit ProtectedBrowserStorage
Public NotInheritable Class ProtectedLocalStorage
Inherits ProtectedBrowserStorage
繼承
ProtectedLocalStorage

建構函式

ProtectedLocalStorage(IJSRuntime, IDataProtectionProvider)

建構 的 ProtectedLocalStorage 實例。

方法

DeleteAsync(String)

以非同步方式刪除針對指定索引鍵儲存的任何資料。

(繼承來源 ProtectedBrowserStorage)
GetAsync<TValue>(String)

以非同步方式擷取指定的資料。

由於此多載未指定任何資料保護用途,因此目的衍生自 key 和存放區名稱。 如果金鑰來自編譯時期已知的固定集合,則這是使用的良好預設用途。

(繼承來源 ProtectedBrowserStorage)
GetAsync<TValue>(String, String)

以非同步方式擷取指定的資料。

(繼承來源 ProtectedBrowserStorage)
SetAsync(String, Object)

以非同步方式儲存指定的資料。

由於此多載未指定任何資料保護用途,因此目的衍生自 key 和存放區名稱。 如果金鑰來自編譯時期已知的固定集合,則這是使用的良好預設用途。

(繼承來源 ProtectedBrowserStorage)
SetAsync(String, String, Object)

以非同步方式儲存提供的資料。

(繼承來源 ProtectedBrowserStorage)

適用於