JCK.Web/common/getNameById.ashx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Data.SqlClient;
using JCK.DBUtility;
using System.Data;

namespace JCK.Web.common
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>

    public class getNameById : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/xml";
            context.Response.Charset = "UTF-8";

            string value = context.Request["value"].ToString();
            string tblcode = context.Request["tblcode"].ToString();
            string tblname = context.Request["tblname"].ToString();
            string tbl = context.Request["tbl"].ToString();

            string res_name = "";


           
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select " + tblname + " from " + tbl + "");

            //if (tblname.Equals("LICENSEDOCU"))
            //{
                strSql.Append(" where " + tblcode + "=@value");
            //}
            //else
            //{
            //    strSql.Append(" where convert(varbinary, " + tblcode + ")=convert(varbinary,@value)");
            //}

            SqlParameter[] parameters = {
                    new SqlParameter("@value", value)
			};

            //parameters[0].Value = value;

            using (SqlDataReader r = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
            {
                if (r.Read())
                {
                    res_name = r[tblname].ToString();
                }
            }
 

            context.Response.Write("<root>");
后面还有 13 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。