public partial class image : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { this.GenImg(this.GenCode(4)); ////将验证码存储到session中,以便需要时进行验证 Session["image"] = this.GenCode(4); } //任意产生4个验证码 private string GenCode(int num) {