加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – Triplet类用于什么?它与元组有关吗?

发布时间:2020-12-15 04:28:07 所属栏目:百科 来源:网络整理
导读:所以我刚刚了解了 Triplet 课程.我没有使用ASP.NET的经验,只有核心.NET Framework. 有人可以向我解释Triplet类存在于何处/原因?它像一个元组? 解决方法 是的,它与.NET 4.0中的Tuple非常相似,但特别是可以追溯到.NET 1.0和ASP.NET 1.0.它主要用于 ViewState
所以我刚刚了解了 Triplet课程.我没有使用ASP.NET的经验,只有核心.NET Framework.

有人可以向我解释Triplet类存在于何处/原因?它像一个元组?

解决方法

是的,它与.NET 4.0中的Tuple非常相似,但特别是可以追溯到.NET 1.0和ASP.NET 1.0.它主要用于 ViewState serialization:

The Page class contains a SavePageViewState(),which is invoked during the page life cycle’s save view state stage. The SavePageViewState() method starts by creating a Triplet that contains the following three items:

  1. The page’s hash code. This hash code is used to ensure that the view state hasn’t been #tampered with between postbacks. We’ll talk more about view state hashing in the “View State and Security Implications” section.
  2. The collective view state of the Page‘s control hierarchy.
  3. An ArrayList of controls in the control hierarchy that need to be explicitly invoked by the page class during the raise postback event stage of the life cycle.

还有它的’弟弟叫Pair.

绝对没有理由你甚至不应该为这些课程烦恼,否则就会产生一种不圣洁的乱七八糟的混乱局面.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读