Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                Receiver _receive = new Receiver("imgsouce/origin");
                //接收文件成功
                _receive.OnSuccess = (data) =>
                {
                    //接收文件成功后,自动生成缩略图
                    // 大图
                    ThumbnailHandle _thumb = new ThumbnailHandle(data, "big", 920);
                    _thumb.AutoHandle();
                    string big = _thumb.GetRelativeName();
                    _log.WriteLine("大图位置:" + big);

                    //小图
                    _thumb.Width  = 320;
                    _thumb.Folder = "small";
                    _thumb.AutoHandle();
                    string small = _thumb.GetRelativeName();
                    _log.WriteLine("小图位置:" + small);

                    data.Data = new { big = big, small = small };

                    //此处,有需要的情况下,执行数据库操作
                    _log.WriteLine(string.Format("新文件名{0},旧文件名{1}", data.NewName, data.OldName));
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public Back_Service()
 {
     InitializeComponent();
     try
     {
         _operate = new BackOperate_Auto();
     }
     catch (Exception ex)
     {
         _log.WriteLine("初始化,操作对象失败:" + ex.Message);
     }
 }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            Receiver _receive = new Receiver();

            //接收文件成功
            _receive.OnSuccess = (data) =>
            {
                //此处,有需要的情况下,执行数据库操作
                _log.WriteLine(string.Format("新文件名{0},旧文件名{1}", data.NewName, data.OldName));
            };
        }
Beispiel #4
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));
            };
        }
Beispiel #5
0
 /// <summary>
 /// 添加备份数据库日志
 /// </summary>
 public void Log_Back(string cmd)
 {
     _log.WriteLine("数据库'" + DBName + "'备份成功,执行命令语句:" + cmd);
 }
Beispiel #6
0
 /// <summary>
 /// 写入内容
 /// </summary>
 /// <param name="content">字符串内容</param>
 public static void Log(string content)
 {
     _log.WriteLine(content);
 }
 /// <summary>
 /// 日志记录
 /// </summary>
 /// <param name="str"></param>
 public static void Log(string str)
 {
     _log.WriteLine(str);
 }