using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebSite
{
    /// <summary>
    /// ValidCode µÄÕªÒªËµÃ÷¡£
    /// </summary>
    public partial class ValidCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Create_ValidCode();
        }

        private void Create_ValidCode()
        {
            FypSystem.Common.ImageExtend image = new FypSystem.Common.ImageExtend();

            string strShowTxt = FypSystem.Common.MathExtend.GetStringRnd("", 5, 2);
            string strMaskTxt = FypSystem.Common.MathExtend.GetStringRnd("\r\n   , < > | ~ `!() - / \\  ", 20);
            Session["valid_code"] = strShowTxt;
            
            System.Drawing.Bitmap bitmap = image.CreateImg(strShowTxt, 5, strMaskTxt, "", 1, 0.5f, true, true, true, "");
            bitmap.Save(this.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
        }
    }
}