王 垚
2022-06-24 c71eab493f627d0d932b717624859b1c21359b58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using WebSRM.Utility;
 
namespace WebSRM.layuiAdmin.std_v1._2._1.src.views.SRM.Api
{
    /// <summary>
    /// SRM_Web_PoBarCodeBillApi 的摘要说明
    /// </summary>
    public class SRM_Web_PoBarCodeBillApi : IHttpHandler
    {
 
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            Stream stream = context.Request.InputStream;
            var linterid = string.Empty;
            using (StreamReader streamRead = new StreamReader(stream))
            {
                linterid = streamRead.ReadToEnd();
                LogService.Write("Cache:"+ linterid);
            }
            //linterid = JsonConvert.SerializeObject(linterid);
            var Cachekey = linterid.Split(';')[1];
            var Cachevalue = linterid.Split(';')[0];
            LogService.Write("Cachekey:" + Cachekey);
            LogService.Write("Cachevalue:" + Cachevalue);
            MemoryCacheHelper.SetCache(Cachekey, Cachevalue);
            //HttpContext.Current.Session.Remove("linterid");
            //HttpContext.Current.Session.Add("linterid", linterid);
 
        }
 
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}