<%@ WebHandler Language="C#" Class="CheckPriKey" %> using System; using System.Collections.Generic; using System.Web; using System.Data; using System.IO; using eMIS.Data; using System.Data.Common; using System.Text; using System.Web.SessionState; using eMIS; public class CheckPriKey : IHttpHandler, IRequiresSessionState { public void ProcessRequest (HttpContext context) { string items = context.Request.QueryString["items"].ToString(); string userId = context.Session["UserId"].ToString(); DataManager dm = new DataManager(); DbDataReader reader = dm.ExecuteReader("select * from xt_user_setting where itemid in ("+items +") and userid=" + userId); string json = "{c:1"; while (reader.Read()) { json += ",item" + reader["itemid"].ToString() + ":'" + reader["itemval"].ToString() + "'"; } reader.Close(); reader = dm.ExecuteReader("select phone,mailAddress,gddh from com_yhb where id=" + userId); if (reader.Read()) { json += ",mobile:'" + reader[0].ToString() + "',mail:'" + reader[1].ToString() + "',phone:'" + reader[2].ToString() + "'"; } reader.Close(); json += "}"; context.Response.ContentType = "text/plain"; context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.Write(json); } public bool IsReusable { get { return false; } } }