<%@ WebHandler Language="c#" Class="Accept_Form" Debug="true" %>
using System;
using System.Web;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using System.Configuration;
using System.Text;
using System.Web.SessionState;

using System.Web.Script.Serialization;
public class Accept_Form : IHttpHandler, IRequiresSessionState //实现这个接口，意味着要实现该接口的两个方法： ProcessRequest和 IsReusable
{


    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        //if (context.Session["CurUserId"] != null)
        //{
        //    string CurUserId = context.Session["CurUserId"].ToString().Trim();
        //}
        if (!Dcx.BLL.VonleHelper.IsLogined(context))
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();
            context.Response.Write(jss.Serialize(new Dcx.Model.ReturnMsg("您还没登陆系统，请登陆后再发布", -1, false)));
            context.Response.End();
            return;
        }
        byte[] input = context.Request.BinaryRead(context.Request.TotalBytes);
        string plshObj = HttpUtility.UrlDecode(System.Text.Encoding.UTF8.GetString(input));
        int ModuleTypeId = Dcx.Common.TypeConverter.StrToInt(HttpUtility.UrlDecode(context.Request.QueryString["ModuleTypeId"]));
        string result = "";
        if (plshObj != null && plshObj.Trim() != "")
           result= Dcx.FormHelper.FormPublish.Accept_Form(ModuleTypeId, plshObj);
        context.Response.Write(result);
        //String callbackFunName = context.Request["callbackparam"];
        //string sdf = HttpUtility.UrlDecode(context.Request["plshObj"]);
        //string sdfsdf = HttpUtility.UrlDecode(sdf);
        //string sdfaasasas = HttpUtility.UrlDecode(context.Request.Form["ffff"]);
        //string sdasasasf = HttpUtility.UrlDecode(context.Request["Publish_ModuleTypeId"]);
        //string ssssdf = HttpUtility.UrlDecode(context.Request.Form["Publish_RunObj"]);
        //string saaadf = HttpUtility.UrlDecode(context.Request.Form["Publish_ModuleTypeId"]);
        //context.Response.Write(callbackFunName + "([ { name:\"John\"}])");
        context.Response.End();

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}
