/*
 * Name:    AjaxLogin Handler 
 * Author:  Alexis
 * Blog:    http://www.cnblogs.com/alexis/
 * Time:    20101106
 * Place:   Shanghai
 **/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MyLogin.Ajax
{
    /// <summary>
    /// Summary description for LoginHandler
    /// </summary>
    public class LoginHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.Buffer = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            context.Response.ContentType = "text/plain";

            string username = context.Request["username"].ToString();
            string password = context.Request["password"].ToString();

            return;
            if (username == "admin" && password == "1")
            {
                context.Response.Write("success");
            }
            else
            {
                context.Response.Write("fail");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

    }
}