Example #1
0
        private static async Task UnZip(ILogger <Program> logger, string path)
        {
            try {
                logger.LogInformation("开始批量解压目录文件:" + path);

                var now = DateTime.Now;
                var key = now.ToString("yyyyMMddHHmm");

                var path1 = Path.Combine(path, "zip");
                var path2 = Path.Combine(path, "extract");

                MonitorZipFileHelper.UnFromDirectory(path1, path2);

                //var zipFiles = ListFiles( path1, key );
                //foreach( var file in zipFiles ) {
                //    logger.LogInformation( "正在处理压缩文件:" + file.Name );
                //    File.Delete( file.FullName );
                //}

                logger.LogInformation("解压完成。" + DateTime.Now);

                await Task.CompletedTask;
            }
            catch (Exception ex) {
                logger.LogError("Syinpo.Monitor.Processor 解压 错误:" + ex.Message);
            }
        }
Example #2
0
        private static async Task UnZip(ILogger <Program> logger, string path)
        {
            logger.LogInformation("开始批量解压目录文件:" + path);

            var path1 = Path.Combine(path, "zip");
            var path2 = Path.Combine(path, "extract");

            MonitorZipFileHelper.UnFromDirectory(path1, path2);

            logger.LogInformation("解压完成。" + DateTime.Now);

            await Task.CompletedTask;
        }