原生html 多选投票

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

using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public class checkHandler : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        try
        {
            context.Response.ContentType = "text/plain";
            string s = context.Request["c"];
            string[] ids = s.Split(',');
            int j = 0;
            foreach (string str in ids)
            {
                j = Convert.ToInt32(str);
            }            
            string sql = "update people set Num=Num+1 where peopleId=" + j;
            int i= SQLHelper.NonExQuery(sql);
            if (i == 1)
            {
                context.Response.Write("上传成功");
            }
        }
        catch(Exception ex)
        {
            context.Response.Write(ex.Message);
        }


    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}

 

posted @ 2018-03-15 14:53  你的斗志并没有失去  阅读(374)  评论(0编辑  收藏  举报