gpt4 book ai didi

asp.net - 我的 VIEWSTATE 是否加密?

转载 作者:行者123 更新时间:2023-12-04 08:29:12 25 4
gpt4 key购买 nike

我有点困惑。我没有明确设置 Web.config <pages ViewStateEncryptionMode="Always" /> ,等等 this MSDN page说它应该默认为 Auto . This MSDN pageAuto如果控件通过调用 RegisterRequiresViewStateEncryption 请求加密,应该使 View 状态信息被加密。方法。但是,我的控件都没有调用该方法。所以看起来我的 View 状态实际上不应该被加密。

但是,当我将 View 状态复制/粘贴到各种 online 之一中时viewstate decoders ,我被告知 View 状态序列化数据无效。那么,我的 View 状态是否加密?有什么明显的方法可以告诉吗?除非禁用它,否则默认的 ASP.net 行为是否已更改为通过默认值对 View 状态进行编码?

最佳答案

如果将其设置为 Always 或 auto,则所有控件状态都将被加密。所有控件调用 RegisterRequiresViewStateEncryption无论自动/始终如何, View 状态都将被加密。如果您的“自定义控件”需要加密,请调用此方法。

MSDN 上看到这个

If you are developing a custom control that deals with potentially sensitive information, call the RegisterRequiresViewStateEncryption method to register the control with the page and ensure view state for the control is encrypted.

The entire page state will be encrypted if the ViewStateEncryptionMode is set to Auto or Always.

关于asp.net - 我的 VIEWSTATE 是否加密?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6343028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com