日期:2014-05-17  浏览次数:20511 次

关于WEB.CONFIG配置SESSIONSTATE的一个小问题
在web.config内配置了sessionstate后,导致验证码文件无法显示图片了
如何能使验证码文件ValidateNum.aspx不进行session的验证呢?

<sessionState mode="InProc" cookieless="false" timeout="60" />

------解决方案--------------------
验证码的..SESSION 配置...单独写 ...
------解决方案--------------------
ValidateBase.cs
C# code

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Security
{
    //该源码下载自www.51aspx.com(51aspx.com)
    /// <summary>
    /// ValidateBase 底层页
    /// </summary>
    public class ValidateBase : System.Web.UI.Page
    {
        public ValidateBase()
        {
           
        }
        /// <summary>
        /// 存放验证码值
        /// </summary>
        public string strValidate
        {
            get
            {
                if (Session["ValidateCode"] != null)
                    return Session["ValidateCode"].ToString();
                else
                    return "";
            }
            set
            {
                Session["ValidateCode"] = value;
            }
        }
     
    }
}