c# 为 IRequiresSessionState 实现 IHttpModule 或 IHttpHandler

发布于 2024-08-03 01:35:32 字数 281 浏览 3 评论 0原文

您好,如何设置 http 处理程序以便可以操作 IRequiresSessionState?我需要更改何时可以访问会话状态。有一个 stackoverflow 问题这花了我 90% 的时间,我对 C# 还太陌生,不知道如何实际实现它并让它工作。如果你们中的一位专家能给我一个快速的 123,我将永远感激不已。

Hi how do I set up an http handler so I can manipulate IRequiresSessionState? I need to change when I can access session state. There is a stackoverflow question that takes me 90% of the way there, I am just too green in c# to know how to actually implement it and get it to work. If one of you experts could give me a quick 123 I would be eternally grateful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

木森分化 2024-08-10 01:35:32

这个答案中的代码似乎是一个相当完整的 HttpModule 实现,保证可以访问会话状态。您能否更具体地说明哪些功能不起作用或您还需要它做什么?

The code in this answer seems to be a pretty complete implementation of a HttpModule that's guaranteed to have access to session state. Could you be more specific about what's not working or what else you need it do to?

风筝有风,海豚有海 2024-08-10 01:35:32

IRequiresSessionState 是一个标记接口。它没有任何成员。没有什么可以实施的。如果用它标记一个类,则该类可以访问会话。就是这么简单。

IRequiresSessionState is a marker interface. It doesn't have any members. There's nothing to implement. If you mark a class with it, the class has access to the Session. It's that simple.

烟─花易冷 2024-08-10 01:35:32

此处是有关如何进行的分步说明使用此功能。

Here is a step by step explanation on how to use this functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文