zoukankan      html  css  js  c++  java
  • 在ashx中使用session

    做一个网站,验证码用ashx输出,发现无法使用session,后来在网上搜了发现

    原来要实现IRequiresSessionState接口

    Imports System
    Imports System.Web

    Public Class Image : Implements IHttpHandler, IRequiresSessionState
        
        
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
            context.Session(
    "YourSession"= "SessionValue"
        
    End Sub

     
        
    Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
            
    Get
                
    Return False
            
    End Get
        
    End Property


    End Class
  • 相关阅读:
    2021/6/17学期总结
    2021/6/16申请加分
    2021/6/15
    2021/6/14
    2021/6/11
    2021/6/10
    2021/6/9
    2021/6/8
    2021/6/7
    2021/6/5读书笔记
  • 原文地址:https://www.cnblogs.com/zhangrou/p/1295236.html
Copyright © 2011-2022 走看看