共用方式為


ProtectedSessionStorage 類別

定義

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

此資料的範圍會限定為目前的瀏覽器索引標籤。如果使用者關閉瀏覽器索引標籤或關閉瀏覽器本身,將會捨棄資料。

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

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

建構函式

ProtectedSessionStorage(IJSRuntime, IDataProtectionProvider)

建構 的 ProtectedSessionStorage 實例。

方法

DeleteAsync(String)

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

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

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

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

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

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

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

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

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

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

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

(繼承來源 ProtectedBrowserStorage)

適用於