日期:2014-05-17 浏览次数:20506 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Security.Cryptography;
using System.Data.SqlClient;
using System.Web.SessionState;
namespace BRS.Ashx
{
/// <summary>
/// Login 的摘要说明
/// </summary>
public class Login : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("TRUE");//测试
string id = context.Request["BRS_id"].ToString();//取用户输入的用户名
string password = FormsAuthentication.HashPasswordForStoringInConfigFile(context.Request["BRS_password"].ToString(), "MD5");//取用户输入的密码并加密
SqlDataReader dr = SQLHelper.ExecuteReader("SELECT lock FROM users WHERE id = '" + id + "'");//注释掉这里是可以正常返回TRUE的
..
...