/// <summary>
/// 读取配置文件信息
/// </summary>
public class ConfigExtensions
{
public static IConfiguration Configuration { get; set; }
static ConfigExtensions()
{
Configuration = new ConfigurationBuilder()
.Add(new JsonConfigurationSource { Path = "appsettings.json", ReloadOnChange = true })
.Build();
}
/// <summary>
/// 获得配置文件的对象值
/// </summary>
/// <param name="jsonPath"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string GetJson(string jsonPath, string key)
{
if (string.IsNullOrEmpty(jsonPath) || string.IsNullOrEmpty(key)) return null;
IConfiguration config = new ConfigurationBuilder().AddJsonFile(jsonPath).Build();//json文件地址
return config.GetSection(key).Value;//json某个对象
}
/// <summary>
/// 根据配置文件和Key获得对象
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="fileName">文件名称</param>
/// <param name="key">节点Key</param>
/// <returns></returns>
public static T GetAppSettings<T>(string fileName, string key) where T : class, new()
{
if (string.IsNullOrEmpty(fileName) || string.IsNullOrEmpty(key)) return null;
var baseDir = AppContext.BaseDirectory + "json/";
var currentClassDir = baseDir; IConfiguration config = new ConfigurationBuilder()
.SetBasePath(currentClassDir)
.Add(new JsonConfigurationSource
{
Path = fileName,
Optional = false,
ReloadOnChange = true
}).Build();
var appconfig = new ServiceCollection().AddOptions()
.Configure<T>(config.GetSection(key))
.BuildServiceProvider()
.GetService<IOptions<T>>()
.Value;
return appconfig;
} /// <summary>
/// 获取自定义配置文件配置
/// </summary>
/// <typeparam name="T">配置模型</typeparam>
/// <param name="key">根节点</param>
/// <param name="configPath">配置文件名称</param>
/// <returns></returns>
public T GetAppSettingss<T>(string key, string configPath) where T : class, new()
{
if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(configPath)) return null;
IConfiguration config = new ConfigurationBuilder().Add
(new JsonConfigurationSource { Path = configPath, ReloadOnChange = true }).Build();
var appconfig = new ServiceCollection()
.AddOptions()
.Configure<T>(config.GetSection(key))
.BuildServiceProvider()
.GetService<IOptions<T>>()
.Value;
return appconfig;
}
/// <summary>
/// 获取自定义配置文件配置(异步方式)
/// </summary>
/// <typeparam name="T">配置模型</typeparam>
/// <param name="key">根节点</param>
/// <param name="configPath">配置文件名称</param>
/// <returns></returns>
public async Task<T> GetAppSettingsAsync<T>(string key, string configPath) where T : class, new()
{
if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(configPath)) return null;
IConfiguration config = new ConfigurationBuilder()
.Add(new JsonConfigurationSource
{
Path = configPath,
ReloadOnChange = true
}).Build();
var appconfig = new ServiceCollection()
.AddOptions()
.Configure<T>(config.GetSection(key))
.BuildServiceProvider()
.GetService<IOptions<T>>()
.Value;
return await Task.Run(() => appconfig);
}
/// <summary>
/// 获取自定义配置文件配置
/// </summary>
/// <typeparam name="T">配置模型</typeparam>
/// <param name="key">根节点</param>
/// <param name="configPath">配置文件名称</param>
/// <returns></returns>
public List<T> GetListAppSettings<T>(string key, string configPath) where T : class, new()
{
if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(configPath)) return null;
IConfiguration config = new ConfigurationBuilder()
.Add(new JsonConfigurationSource { Path = configPath, ReloadOnChange = true }).Build();
var appconfig = new ServiceCollection()
.AddOptions()
.Configure<List<T>>(config.GetSection(key))
.BuildServiceProvider()
.GetService<IOptions<List<T>>>()
.Value;
return appconfig;
} /// <summary>
/// 获取自定义配置文件配置(异步方式)
/// </summary>
/// <typeparam name="T">配置模型</typeparam>
/// <param name="key">根节点</param>
/// <param name="configPath">配置文件名称</param>
/// <returns></returns>
public async Task<List<T>> GetListAppSettingsAsync<T>(string key, string configPath) where T : class, new()
{
if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(configPath)) return null;
IConfiguration config = new ConfigurationBuilder()
.Add(new JsonConfigurationSource { Path = configPath, ReloadOnChange = true })
.Build();
var appconfig = new ServiceCollection()
.AddOptions()
.Configure<List<T>>(config.GetSection(key))
.BuildServiceProvider()
.GetService<IOptions<List<T>>>()
.Value;
return await Task.Run(() => appconfig);
}
}

  文件读取类:

public class FileHelperCore
{
private static IHostingEnvironment _hostingEnvironment = new
HttpContextAccessor().HttpContext.RequestServices.GetService
(typeof(IHostingEnvironment)) as IHostingEnvironment;
/// <summary>
/// 目录分隔符
/// windows "\" OSX and Linux "/"
/// </summary>
private static string DirectorySeparatorChar = Path.DirectorySeparatorChar.ToString();
/// <summary>
/// 包含应用程序的目录的绝对路径
/// </summary>
private static string _ContentRootPath = _hostingEnvironment.ContentRootPath;
#region 检测指定路径是否存在 /// <summary>
/// 检测指定路径是否存在
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static bool IsExist(string path)
{
if (string.IsNullOrEmpty(path)) return false;
return IsDirectory(MapPath(path)) ?
Directory.Exists(MapPath(path)) :
File.Exists(MapPath(path));
}
/// <summary>
/// 检测指定路径是否存在(异步方式)
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static async Task<bool> IsExistAsync(string path)
{
if (string.IsNullOrEmpty(path)) return false;
return await Task.Run(() => IsDirectory(MapPath(path)) ?
Directory.Exists(MapPath(path)) :
File.Exists(MapPath(path)));
}
#endregion #region 检测目录是否为空 /// <summary>
/// 检测目录是否为空
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static bool IsEmptyDirectory(string path)
{
if (string.IsNullOrEmpty(path)) return false;
return Directory.GetFiles(MapPath(path)).Length <= 0
&& Directory.GetDirectories(MapPath(path)).Length <= 0;
}
/// <summary>
/// 检测目录是否为空
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static async Task<bool> IsEmptyDirectoryAsync(string path)
{
if (string.IsNullOrEmpty(path)) return false;
return await Task.Run(() => Directory.GetFiles(MapPath(path)).Length <= 0
&& Directory.GetDirectories(MapPath(path)).Length <= 0);
}
#endregion #region 创建目录 /// <summary>
/// 创建目录
/// </summary>
/// <param name="path">路径</param>
public static void CreateFiles(string path)
{
if (string.IsNullOrEmpty(path)) return;
try
{
if (IsDirectory(MapPath(path)))
Directory.CreateDirectory(MapPath(path));
else
File.Create(MapPath(path)).Dispose();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion #region 删除文件或目录 /// <summary>
/// 删除目录或文件
/// </summary>
/// <param name="path">路径</param>
public static void DeleteFiles(string path)
{
if (string.IsNullOrEmpty(path)) return;
try
{
if (IsExist(path))
{
if (IsDirectory(MapPath(path)))
Directory.Delete(MapPath(path));
else
File.Delete(MapPath(path));
}
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 清空目录下所有文件及子目录,依然保留该目录
/// </summary>
/// <param name="path"></param>
public static void ClearDirectory(string path)
{
if (string.IsNullOrEmpty(path)) return;
if (IsExist(path))
{
//目录下所有文件
string[] files = Directory.GetFiles(MapPath(path));
foreach (var file in files)
{
DeleteFiles(file);
}
//目录下所有子目录
string[] directorys = Directory.GetDirectories(MapPath(path));
foreach (var dir in directorys)
{
DeleteFiles(dir);
}
}
}
#endregion #region 判断文件是否为隐藏文件(系统独占文件) /// <summary>
/// 检测文件或文件夹是否为隐藏文件
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static bool IsHiddenFile(string path)
{
if (string.IsNullOrEmpty(path)) return false;
return IsDirectory(MapPath(path)) ?
InspectHiddenFile(
new DirectoryInfo(MapPath(path))) :
InspectHiddenFile(new FileInfo(MapPath(path)));
} /// <summary>
/// 检测文件或文件夹是否为隐藏文件(异步方式)
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static async Task<bool> IsHiddenFileAsync(string path)
{
if (string.IsNullOrEmpty(path)) return false;
return await Task.Run(() =>
IsDirectory(MapPath(path)) ? InspectHiddenFile(new DirectoryInfo(MapPath(path))) :
InspectHiddenFile(new FileInfo(MapPath(path))));
}
/// <summary>
/// 私有方法 文件是否为隐藏文件(系统独占文件)
/// </summary>
/// <param name="fileSystemInfo"></param>
/// <returns></returns>
private static bool InspectHiddenFile(FileSystemInfo fileSystemInfo)
{
if (fileSystemInfo == null) return false;
if (fileSystemInfo.Name.StartsWith("."))
{
return true;
}
else if (fileSystemInfo.Exists &&
((fileSystemInfo.Attributes & FileAttributes.Hidden) != 0 ||
(fileSystemInfo.Attributes & FileAttributes.System) != 0))
{
return true;
}
return false;
}
#endregion #region 文件操作 #region 复制文件
/// <summary>
/// 复制文件内容到目标文件夹
/// </summary>
/// <param name="sourcePath">源文件</param>
/// <param name="targetPath">目标文件夹</param>
/// <param name="isOverWrite">是否可以覆盖</param>
public static void Copy(string sourcePath, string targetPath, bool isOverWrite = true)
{
if (string.IsNullOrEmpty(sourcePath) || string.IsNullOrEmpty(targetPath)) return;
File.Copy(MapPath(sourcePath), MapPath(targetPath) +
GetFileName(sourcePath), isOverWrite);
} /// <summary>
/// 复制文件内容到目标文件夹
/// </summary>
/// <param name="sourcePath">源文件</param>
/// <param name="targetPath">目标文件夹</param>
/// <param name="newName">新文件名称</param>
/// <param name="isOverWrite">是否可以覆盖</param>
public static void Copy(string sourcePath, string targetPath, string newName, bool isOverWrite = true)
{
if (string.IsNullOrEmpty(sourcePath) || string.IsNullOrEmpty(targetPath)) return;
File.Copy(MapPath(sourcePath), MapPath(targetPath) + newName, isOverWrite);
}
#endregion #region 移动文件
/// <summary>
/// 移动文件到目标目录
/// </summary>
/// <param name="sourcePath">源文件</param>
/// <param name="targetPath">目标目录</param>
public static void Move(string sourcePath, string targetPath)
{
if (string.IsNullOrEmpty(sourcePath) || string.IsNullOrEmpty(targetPath)) return;
string sourceFileName = GetFileName(sourcePath);
//如果目标目录不存在则创建
if (IsExist(targetPath))
{
CreateFiles(targetPath);
}
else
{
//如果目标目录存在同名文件则删除
if (IsExist(Path.Combine(MapPath(targetPath), sourceFileName)))
{
DeleteFiles(Path.Combine(MapPath(targetPath), sourceFileName));
}
}
File.Move(MapPath(sourcePath), Path.Combine(MapPath(targetPath), sourcePath));
} #endregion /// <summary>
/// 获取文件名和扩展名
/// </summary>
/// <param name="path">文件路径</param>
/// <returns></returns>
public static string GetFileName(string path)
{
if (string.IsNullOrEmpty(path)) return path;
return Path.GetFileName(MapPath(path));
} /// <summary>
/// 获取文件名不带扩展名
/// </summary>
/// <param name="path">文件路径</param>
/// <returns></returns>
public static string GetFileNameWithOutExtension(string path)
{
if (string.IsNullOrEmpty(path)) return path;
return Path.GetFileNameWithoutExtension(MapPath(path));
}
/// <summary>
/// 获取文件扩展名
/// </summary>
/// <param name="path">文件路径</param>
/// <returns></returns>
public static string GetFileExtension(string path)
{
if (string.IsNullOrEmpty(path)) return path;
return Path.GetExtension(MapPath(path));
}
#endregion #region 获取文件绝对路径
/// <summary>
/// 获取文件绝对路径
/// </summary>
/// <param name="path">文件路径</param>
/// <returns></returns>
public static string MapPath(string path)
{
if (string.IsNullOrEmpty(path)) return path;
return Path.Combine(_ContentRootPath, path.TrimStart('~', '/').Replace("/", DirectorySeparatorChar));
} /// <summary>
/// 获取文件绝对路径(异步方式)
/// </summary>
/// <param name="path">文件路径</param>
/// <returns></returns>
public static async Task<string> MapPathAsync(string path)
{
if (string.IsNullOrEmpty(path)) return path;
return await Task.Run(()=>
Path.Combine(_ContentRootPath,path.TrimStart('~','/').
Replace("/", DirectorySeparatorChar)));
}
/// <summary>
/// 是否为目录或文件夹
/// </summary>
/// <param name="path">路径</param>
/// <returns></returns>
public static bool IsDirectory(string path)
{
if (string.IsNullOrEmpty(path)) return false;
if (path.EndsWith(DirectorySeparatorChar))
return true;
else
return false;
}
#endregion #region 物理路径转虚拟路径
public static string PhysicalToVirtual(string physicalPath)
{
if (string.IsNullOrEmpty(physicalPath)) return physicalPath;
return physicalPath.Replace(_ContentRootPath, "").Replace(DirectorySeparatorChar, "/");
}
#endregion #region 文件格式
/// <summary>
/// 是否可添加水印
/// </summary>
/// <param name="_fileExt">文件扩展名,不含“.”</param>
/// <returns></returns>
public static bool IsCanWater(string _fileExt)
{
if (string.IsNullOrEmpty(_fileExt)) return false;
var images = new List<string> { "jpg", "jpeg" };
if (images.Contains(_fileExt.ToLower())) return true;
return false;
}
/// <summary>
/// 是否为图片
/// </summary>
/// <param name="_fileExt">文件扩展名,不含“.”</param>
/// <returns></returns>
public static bool IsImage(string _fileExt)
{
if (string.IsNullOrEmpty(_fileExt)) return false;
var images = new List<string> { "bmp", "gif", "jpg", "jpeg", "png" };
if (images.Contains(_fileExt.ToLower())) return true;
return false;
} /// <summary>
/// 是否为视频
/// </summary>
/// <param name="_fileExt">文件扩展名,不含“.”</param>
/// <returns></returns>
public static bool IsVideos(string _fileExt)
{
if (string.IsNullOrEmpty(_fileExt)) return false;
var videos=new List<string> { "rmvb", "mkv", "ts", "wma", "avi", "rm", "mp4", "flv", "mpeg", "mov", "3gp", "mpg" };
if (videos.Contains(_fileExt.ToLower())) return true;
return false;
} /// <summary>
/// 是否为音频
/// </summary>
/// <param name="_fileExt">文件扩展名,不含“.”</param>
/// <returns></returns>
public static bool IsMusics(string _fileExt)
{
if (string.IsNullOrEmpty(_fileExt)) return false;
var musics = new List<string> { "mp3", "wav" };
if (musics.Contains(_fileExt.ToLower())) return true;
return false;
} /// <summary>
/// 是否为文档
/// </summary>
/// <param name="_fileExt">文件扩展名,不含“.”</param>
/// <returns></returns>
public static bool IsDocument(string _fileExt)
{
if (string.IsNullOrEmpty(_fileExt)) return false;
var documents = new List<string> { "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf" };
if (documents.Contains(_fileExt.ToLower())) return true;
return false;
}
#endregion #region 文件图标
public static string FindFileIcon(string fileExt)
{
if (string.IsNullOrEmpty(fileExt)) return fileExt;
if (IsImage(fileExt))
return "fa fa-image";
if (IsVideos(fileExt))
return "fa fa-film";
if (IsMusics(fileExt))
return "fa fa-music";
if(IsDocument(fileExt))
switch (fileExt.ToLower())
{
case ".xls":
case ".xlsx":
return "fa fa-file-excel-o";
case ".ppt":
case ".pptx":
return "fa fa-file-powerpoint-o";
case ".pdf":
return "fa fa-file-pdf-o";
case ".txt":
return "fa fa-file-text-o";
default:
return "fa fa-file-word-o";
}
if (fileExt.ToLower() == "zip" || fileExt.ToLower() == "rar")
return "fa fa-file-zip-o";
else
return "fa fa-file";
}
#endregion
#region 文件大小转换
/// <summary>
/// 文件大小转为B、KB、MB、GB...
/// </summary>
/// <param name="size"></param>
/// <returns></returns>
public static string FileSizeTransf(long size)
{
if (size==0) return null;
String[] units = new String[] { "B", "KB", "MB", "GB", "TB", "PB" };
long mod = 1024;
int i = 0;
while (size > mod)
{
size /= mod;
i++;
}
return size + units[i];
}
#endregion
#region 获取目录下所有文件
public static List<FilesInfo> FindFiles(string path, string staticFiles = "/wwwroot")
{
if (string.IsNullOrEmpty(path)) return null;
string[] folders = Directory.GetDirectories(MapPath(path), "*", SearchOption.AllDirectories);
var Files = new List<FilesInfo>();
foreach (var folder in folders)
{
foreach (var fsi in new DirectoryInfo(folder).GetFiles())
{
Files.Add(new FilesInfo()
{
Name = fsi.Name,
FullName = fsi.FullName,
FileExt = fsi.Extension,
FileOriginalSize = fsi.Length,
FileSize = FileSizeTransf(fsi.Length),
FileIcon = FindFileIcon(fsi.Extension.Remove(0, 1)),
FileName = PhysicalToVirtual(fsi.FullName).Replace(staticFiles, ""),
FileStyle = IsImage(fsi.Extension.Remove(0, 1)) ? "images" :
IsDocument(fsi.Extension.Remove(0, 1)) ? "documents" :
IsVideos(fsi.Extension.Remove(0, 1)) ? "videos" :
IsMusics(fsi.Extension.Remove(0, 1)) ? "musics" : "others",
CreateDate = fsi.CreationTime,
LastWriteDate = fsi.LastWriteTime,
LastAccessDate = fsi.LastAccessTime
});
}
}
return Files;
}
/// <summary>
/// 获得指定文件夹下面的所有文件
/// </summary>
/// <param name="path"></param>
/// <param name="staticFiles"></param>
/// <returns></returns>
public static List<FilesInfo> ResolveFileInfo(string path, string staticFiles = "/wwwroot")
{
if (string.IsNullOrEmpty(path)) return null;
var foldersPath = MapPath(path);
var Files = new List<FilesInfo>();
foreach (var fsi in new DirectoryInfo(foldersPath).GetFiles())
{
Files.Add(new FilesInfo()
{
Name = fsi.Name,
FullName = fsi.FullName,
FileExt = fsi.Extension,
FileOriginalSize = fsi.Length,
FileSize = FileSizeTransf(fsi.Length),
FileIcon = FindFileIcon(fsi.Extension.Remove(0, 1)),
FileName = PhysicalToVirtual(fsi.FullName).Replace(staticFiles, ""),
FileStyle = IsImage(fsi.Extension.Remove(0, 1)) ? "images" :
IsDocument(fsi.Extension.Remove(0, 1)) ? "documents" :
IsVideos(fsi.Extension.Remove(0, 1)) ? "videos" :
IsMusics(fsi.Extension.Remove(0, 1)) ? "musics" : "others",
CreateDate = fsi.CreationTime,
LastWriteDate = fsi.LastWriteTime,
LastAccessDate = fsi.LastAccessTime
});
}
return Files;
}
#endregion
}
public class FilesInfo
{
/// <summary>
/// 文件名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 文件物理路径
/// </summary>
public string FullName { get; set; }
/// <summary>
/// 扩展名
/// </summary>
public string FileExt { get; set; }
/// <summary>
/// 原始大小(字节)
/// </summary>
public long FileOriginalSize { get; set; }
/// <summary>
/// 文件大小
/// </summary>
public string FileSize { get; set; }
/// <summary>
/// 文件虚拟路径
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 文件类型
/// </summary>
public string FileStyle { get; set; }
/// <summary>
/// 文件图标
/// </summary>
public string FileIcon { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 最后修改时间
/// </summary>
public DateTime LastWriteDate { get; set; }
/// <summary>
/// 最后访问时间
/// </summary>
public DateTime LastAccessDate { get; set; } }

  

Asp.NetCore 读取配置文件帮助类的更多相关文章

  1. CSharp读取配置文件的类(简单实现)

    Reinventing the wheel 系列 CSharp 读取配置文件的类 简单实现(注意没有写) 本人对CS 不是很熟,库也不熟,所以到网上找个实现,并自己添加了点异常.如果只是读取信息,足够 ...

  2. asp.net 读取配置文件方法

    方法1: System.Collections.Specialized.NameValueCollection nvc = (System.Collections.Specialized.NameVa ...

  3. ASP.NET读取配置文件发送邮件

    之前写过一篇文章C#使用SMTP发送邮件 后来做了改进,改成读取独立的配置文件,本文只记录读取配置文件的部分,发送部分见上面的链接. 读取配置文件C#代码: using System; using S ...

  4. spring读取配置文件PropertyPlaceholderConfigurer类的使用

    这里主要介绍PropertyPlaceholderConfigurer这个类的使用,spring中的该类主要用来读取配置文件并将配置文件中的变量设置到上下文环境中,并进行赋值. 一.此处使用list标 ...

  5. .netcore读取配置文件

    setting.json { "compilerOptions": { "noImplicitAny": false, "noEmitOnError& ...

  6. PropertiesUtil 读取配置文件工具类

    package org.konghao.basic.util; import java.io.FileInputStream; import java.io.FileNotFoundException ...

  7. ConfigUtil读取配置文件工具类

    ConfigUtil package com.sso.util; import java.io.FileNotFoundException; import java.io.IOException; i ...

  8. .NetCore 读取配置文件

    1.创建config.json配置,并设置成始终复制 2.需要安装 nuget 包 Microsoft.Extensions.Configuration .Microsoft.Extensions.C ...

  9. IT咨询顾问:一次吐血的项目救火 java或判断优化小技巧 asp.net core Session的测试使用心得 【.NET架构】BIM软件架构02:Web管控平台后台架构 NetCore入门篇:(十一)NetCore项目读取配置文件appsettings.json 使用LINQ生成Where的SQL语句 js_jquery_创建cookie有效期问题_时区问题

    IT咨询顾问:一次吐血的项目救火   年后的一个合作公司上线了一个子业务系统,对接公司内部的单点系统.我收到该公司的技术咨询:项目启动后没有规律的突然无法登录了,重新启动后,登录一断时间后又无法重新登 ...

随机推荐

  1. [转] 如何轻松愉快地理解条件随机场(CRF)?

    原文链接:https://www.jianshu.com/p/55755fc649b1 如何轻松愉快地理解条件随机场(CRF)?   理解条件随机场最好的办法就是用一个现实的例子来说明它.但是目前中文 ...

  2. 用Vue实现状态列表的操作涵盖所有的知识点

    用Vue实现状态列表的操作涵盖所有的知识点

  3. cisco和华为的设备如何设置命令不分页显示

    作者:邓聪聪 为了登陆设备查看信息没有分页,cisco和华为的设备上可以设置不分页显示 Cisco: > terminal length HUAWEI / H3C: > user-inte ...

  4. requests库入门13-会话对象

    会话对象可以在跨请求保持某些参数,会话对象有requests api的大部分方法,我理解会话对象就是一个资源共享池 使用requests.Session()可以创建会话对象的实例 还是以之前GitHu ...

  5. Bootstrap3.0入门学习系列教程

    可视化布局:http://www.runoob.com/try/bootstrap/layoutit/ 1.浏览器兼容性:你可以去看看大牛的一篇文章http://www.cnblogs.com/lhb ...

  6. VUE环境部署

     npm install vue-router --save 下载node.js安装https://nodejs.org/en/ npm install -g cnpm --registry=http ...

  7. GNU Wget 1.19.1 static built on mingw32

    http://pan.baidu.com/s/1sluFAVj #wget --version GNU Wget 1.19.1 built on mingw32. -cares +digest -gp ...

  8. web-font 个人学习小总结

    个人觉得 web-font  分为两种: 第一种就是真正文本字体,客户端没有安装的字体通过远程加载字体来实现特殊字体提高用户体验: icodon.com : http://icodon.com/goo ...

  9. $Django 路飞之课程下的分类,用户登陆成功前端存cookie,

    一 课程分类显示 宗旨:总的再次过滤 二 Cookie # export default new Vuex.Store({ state: { name:'', token:'', }, mutatio ...

  10. 【原创】大叔经验分享(39)spark cache unpersist级联操作

    问题:spark中如果有两个DataFrame(或者DataSet),DataFrameA依赖DataFrameB,并且两个DataFrame都进行了cache,将DataFrameB unpersi ...