private static ScriptExecuteDetailResult addRe(int currentScript_id, JObject job)
        {
            ScriptExecuteDetailResult model = new ScriptExecuteDetailResult();

            model.ser_id     = currentScript_id;
            model.ScriptName = job["ScriptName"].ToString();
            model.IsSucceed  = job["IsSucceed"].ToString();//ON表示其他
            model.EndDate    = job["EndDate"].ToString();
            model.Terminal   = job["terminal"].ToString();
            string s          = job["taskNum"].ToString();
            int    startIndex = s.IndexOf("-");
            int    start      = startIndex + 1;
            string a          = s.Substring(start);
            int    taskNum    = Convert.ToInt32(a);

            model.TaskNum           = taskNum;
            model.StartDate         = job["StartDate"].ToString();
            model.DeviceName        = job["DeviceName"].ToString();
            model.ExecuteTrimLenght = Convert.ToInt16(job["ExecuteTrimLenght"]);
            model.LogFilePath       = job["LogFilePath"].ToString();
            model.Remark            = job["remark"].ToString();
            return(model);
        }
        private static void Result(IAsyncResult ar)
        {
            listener.BeginGetContext(Result, null);
            Console.WriteLine($"接到新的请求");
            var context  = listener.EndGetContext(ar);
            var request  = context.Request;
            var response = context.Response;

            context.Response.ContentType = "text/plain;charset=UTF-8";//告诉客户端返回的ContentType类型为纯文本格式,编码为UTF-8
            //context.Response.AddHeader("Content-type", "text/plain");//添加响应头信息
            context.Response.ContentEncoding = Encoding.UTF8;
            string returnObj = null;//定义返回客户端的信息

            if (request.HttpMethod == "POST" && request.InputStream != null)
            {
                try
                {
                    Stream       stream    = request.InputStream;
                    StreamReader strStream = new StreamReader(stream, Encoding.UTF8);
                    string       retString = strStream.ReadToEnd();

                    stream.Close();
                    strStream.Close();
                    //var ret = JObject.Parse(retString).ToObject<Dictionary<String, object>>();
                    //Dictionary<String,object> ret = JsonConvert.DeserializeObject<Dictionary<String, object>>(retString);
                    //Dictionary<String,List<Message>> me = JsonConvert.DeserializeObject<Dictionary<String, List<Message>>>(ret["Table"].ToString());
                    //JArray jarray = JArray.Parse(ret["Table"].ToString());
                    JArray jarray = JArray.Parse(retString);
                    foreach (var jsonitem in jarray)
                    {
                        JObject job    = (JObject)jsonitem;
                        int     ser_id = AddScriptResult(job);
                        ScriptExecuteDetailResult model  = addRe(ser_id, job);
                        StringBuilder             strSql = new StringBuilder();
                        strSql.Append("insert into ScriptExecuteDetailResult(");
                        strSql.Append("ScriptName,ser_id,IsSucceed,StartDate,EndDate,LogFilePath,terminal,isDel,DeviceName,ExecuteTrimLenght,remark,TaskNum,IsUnLoad)");
                        strSql.Append(" values (");
                        strSql.Append("@ScriptName,@ser_id,@IsSucceed,@StartDate,@EndDate,@LogFilePath,@terminal,@isDel,@DeviceName,@ExecuteTrimLenght,@remark,@TaskNum,0)");
                        strSql.Append(";select LAST_INSERT_ROWID()");
                        SQLiteParameter[] parameters =
                        {
                            new SQLiteParameter("@ScriptName",        DbType.String),
                            new SQLiteParameter("@ser_id",            DbType.Int32,      8),
                            new SQLiteParameter("@IsSucceed",         DbType.String),
                            new SQLiteParameter("@StartDate",         DbType.String),
                            new SQLiteParameter("@EndDate",           DbType.String),
                            new SQLiteParameter("@LogFilePath",       DbType.String),
                            new SQLiteParameter("@terminal",          DbType.String),
                            new SQLiteParameter("@isDel",             DbType.Int16,      4),
                            new SQLiteParameter("@DeviceName",        DbType.String,    50),
                            new SQLiteParameter("@ExecuteTrimLenght", DbType.Int16,      4),
                            new SQLiteParameter("@remark",            DbType.String,  1000),
                            new SQLiteParameter("@TaskNum",           DbType.Int32, 8)
                        };
                        parameters[0].Value  = model.ScriptName;
                        parameters[1].Value  = model.ser_id;
                        parameters[2].Value  = model.IsSucceed;
                        parameters[3].Value  = model.StartDate;
                        parameters[4].Value  = model.EndDate;
                        parameters[5].Value  = model.LogFilePath;
                        parameters[6].Value  = model.Terminal;
                        parameters[7].Value  = model.IsDel;
                        parameters[8].Value  = model.DeviceName;
                        parameters[9].Value  = model.ExecuteTrimLenght;
                        parameters[10].Value = model.Remark;
                        parameters[11].Value = model.TaskNum;

                        object obj = SqliteHelpDao.ExecuteScalar(ConnectionString, CommandType.Text, strSql.ToString(), parameters);
                        int    a;
                        if (obj == null)
                        {
                            a = 0;
                        }
                        else
                        {
                            a = Convert.ToInt32(obj);
                        }
                    }
                    response.StatusDescription = "200"; //获取或设置返回给客户端的 HTTP 状态代码的文本说明。
                    response.StatusCode        = 200;   // 获取或设置返回给客户端的 HTTP 状态代码。
                    returnObj = "已收到,接收成功";
                }
                catch (Exception ex)
                {
                    response.StatusDescription = "404";
                    response.StatusCode        = 404;
                    returnObj = ex.Message;
                }

                Stream outstream = response.OutputStream;
                byte[] buffer    = Encoding.UTF8.GetBytes(returnObj);
                outstream.Write(buffer, 0, buffer.Length);
                outstream.Close();
            }
        }