zoukankan      html  css  js  c++  java
  • 一般处理程序乱码解决方法

    <%@ WebHandler Language="C#" Class="AttendanceHandHandler" %>

    using System;
    using System.Web;
    using System.Data;
    using MyJobSky.MIS.BLL.Attendance;
    public class AttendanceHandHandler : IHttpHandler
    {

    public void ProcessRequest(HttpContext context)
    {


    context.Response.ContentType = "text/plain";
    string sRes = "";
    try
    {
    string mobile = context.Request["mobile"].ToString();//saveID前台的id数组

    if (dt.Rows.Count > 0) { sRes = mobile; } else { sRes = ""; }
    }
    catch (Exception ex)
    {
    MyJobSky.Common.LogManger.Error(ex.ToString());
    }
    System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();//转码防止乱码

    context.Response.Write(jss.Serialize(sRes));
    context.Response.End();
    }

    public bool IsReusable
    {
    get
    {
    return false;
    }
    }

    }

  • 相关阅读:
    JAVA学习25天
    Java学习第24天
    Java学习第23天
    Java学习22天
    第3周
    Java21
    day23作业
    day23
    Typecho使用技巧
    搭建Typecho博客
  • 原文地址:https://www.cnblogs.com/momjs/p/5948675.html
Copyright © 2011-2022 走看看