简体   繁体   English

如何使用c#获取或设置localStorage或sessionStorage存储?

[英]how to get or set localStorage or sessionStorage storage using c#?

I need to find a way to get or set data, to or from localStorage or sessionStorage using C#. 我需要找到一种方法来使用C#从localStoragesessionStorage获取或设置数据。 Is there a way to do this ? 有没有办法做到这一点 ?

Directly no. 直接没有。 They're both client side and only accessible through JavaScript they never end up being serialised back to the server where the C# runs. 它们既是客户端又只能通过JavaScript访问,它们永远不会被序列化回C#运行的服务器。

However, you could use JavaScript and have it talk to the C# side using AJAX or some such. 但是,您可以使用JavaScript并使用AJAX或其他方式与C#端进行通信。

You can do it from JavaScript. 你可以用JavaScript做到这一点。 refer below link for the same : 请参阅以下链接:

Local Storage and Session Storage 本地存储和会话存储

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何清除 C# 中的 javascript SessionStorage - How to clear javascript SessionStorage in C# 如何使用C#获得MTP设备的可用存储和存储容量? - How to get MTP device Available Storage & Storage Capacity using C#? 如何使用 C# 中的 Azure.Storage.Blobs 以 ByteArray 格式从 Azure 存储 blob 中获取文件 - How to get file from Azure storage blob in a ByteArray format using Azure.Storage.Blobs in C# 如何通过C#获取Azure列表存储? - How to get Azure list storage by c#? 如何使用 C# 使用 ALSA 在 Linux 中获取和设置音量? - How to get and set volume in Linux using ALSA using C#? 如何使用CultureInfo在C#中获取和设置小数点分隔符 - How to get and set decimal separator in C# using CultureInfo 如何在XSockets中使用C#客户端API获取/设置属性 - How to Get/Set Properties using the C# client API in XSockets 如何在 C# 中使用 AddAdditionalCapability 设置 Saucelabs 隧道标识符? - How to get Saucelabs tunnelidentifier set up using AddAdditionalCapability in C#? 如何使用 C# 获取和设置 DLL 文件的详细信息 - How to get and set DLL file details, using C# 如何使用 C# 只读属性? 使用 get set 还是 lambda? - How to use C# readonly property? Using get set or lambda?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM