Ejemplo n.º 1
0
        /// <summary>
        /// 静态内容初始化
        /// </summary>
        static BackLog()
        {
            //将 日志记录放在当前DLL的目录下
            string fullname = LocalPathHelper.GetCurrentDLLSub("log") + "\\MySqlBack_Log.txt";

            _log = new LogHelper.LogHelper(fullname, true);
        }
Ejemplo n.º 2
0
        public async Task Invoke(HttpContext context)
        {
            var pflog = new LogHelper.LogHelper().CreatePFLogDetail("i am remark");

            pflog.StartTime = DateTime.Now;

            _sw.Reset();
            _sw.Start();

            await _next(context);

            _sw.Stop();
            pflog.TimeLength = _sw.ElapsedMilliseconds;

            GetHttpContextDetail(context, pflog);

            Log.Logger.Information("Request completed {@pflog}", pflog);
        }
Ejemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            //var req = context.Request;
            //if (req.Files.Count > 0)
            //{
            //    //保存文件
            //    HttpPostedFile file = req.Files[0];
            //    file.SaveAs(@"I:\" + file.FileName);
            //    context.Response.ContentType = "text/plain";
            //    context.Response.Write("文件接收成功");
            //}


            LogHelper.LogHelper _log     = new LogHelper.LogHelper();
            FormReceiver        _receive = new FormReceiver();

            //接收文件成功
            _receive.OnSuccess = (data) =>
            {
                //此处,有需要的情况下,执行数据库操作
                _log.WriteLine(string.Format("新文件名{0},旧文件名{1}", data.NewName, data.OldName));
            };
        }
Ejemplo n.º 4
0
 public BackBase(HostInfo HostInfo)
 {
     _log          = BackLog.GetLog();
     this.HostInfo = HostInfo;
 }