.net core 设置读取JSON配置文件 appsettings.json Startup.cs 中 public class Startup { public Startup(IHostingEnvironment env) { Configuration = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, r
用于永久化对象,什么程序都行,依赖NewtonSoft.用于json序列化和反序列化. using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConfigHandler { public class ConfigHandl
工作除了开发最新的版本之外还要对原来的版本做例行的维护,修修补补.于是有了在两个分支之间游走切换的问题,最新改版的代码在分支 new 上,旧版本的代码在分支 old 上,我在 new 上开发了一半,忽然有人给了我一个改进的需求,于是我要切换回 old 去修改代码.在这个场景下,我摸索了三种方法: 及时 commit 代码 在 new 分支上把已经开发完成的部分代码 commit 掉,不 push,然后切换到 old 分支修改代码,做完了commit,所有分支互不影响,这是一个理想的方法. 使用
图片上传首先要是设置settings.py文件(与静态文件设置类似) MEDIA_ROOT = os.path.join(BASE_DIR,'media')MEDIA_URL = '/media/' 1.需要用到imagekit软件安装使用imagekit需要以下三步:1)Install PIL or Pillow. (If you’re using an ImageField in Django, you should have already done this.)2)pip install