public void ProcessRequest (HttpContext context)
{
Message header
String email_title = Dsis.Core.SysCore.PubFunction.DataFilter (Dsis.Core.SysCore.SysFunction.GetParameterInfo (" Email_title ") [" PValue "]);
Context. Response.ContentType = "Text/plain";
The mailbox sent
String Stremail = context. request.querystring["email"];
Send data through the mailbox interface, and then record cookies when successful
Random number
String randdata = Generaterandomnumber (6);
Dsis.Core.BizCore.Email.SendTo (Stremail, Email_title, "You are receiving the verification code through the mailbox, the verification code is" + Randdata);
HttpCookie cookie = new HttpCookie ("Emailrandcode");
Cookies. Values.add ("Checkcode", randdata);
Cookies. Values.add ("Curdatetime", System.DateTime.Now.ToString ());
Cookies. Expires.addseconds (60);
Context. Response.appendcookie (cookie);
}
private static char[] constant =
{
' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 '//,
' A ', ' B ', ' C ', ' d ', ' e ', ' f ', ' g ', ' h ', ' I ', ' j ', ' K ', ' l ', ' m ', ' n ', ' o ', ' P ', ' Q ', ' R ', ' s ', ' t ', ' u ', ' V ', ' w ', ' x ', ' y ', ' z ',
' A ', ' B ', ' C ', ' D ', ' E ', ' F ', ' G ', ' H ', ' I ', ' J ', ' K ', ' L ', ' M ', ' N ', ' O ', ' P ', ' Q ', ' R ', ' S ', ' T ', ' U ', ' V ', ' W ', ' X ', ' Y ', ' Z '
};
public static string Generaterandomnumber (int Length)
{
System.Text.StringBuilder newrandom = new System.Text.StringBuilder (10);//62);
Random rd = new random ();
for (int i = 0; i < Length; i++)
{
Newrandom.append (constant[rd. Next (10)]); (//62)]);
}
return newrandom.tostring ();
}
public bool IsReusable
{
Get
{
return true;
}
}
Randomly generate a number (ashx file, call the previous write send message code)