调试的时候数据库正常,IIS里访问就不行了,求助!
VS2010 SQL2008 IIS6
LOGIN.ASHX
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的
..
...