11 2021 档案
摘要:Nuget安装:Microsoft.AspNetCore.Authentication.JwtBearer appsetting.json中添加配置项 public class LoginController : ControllerBase { public IConfiguration Conf
阅读全文
摘要:1,泛型方法 2,泛型类 Public Class PersonHelper<T>Where T:Person,new()//确定了该类一定是 Person类或子类 new()表示可以用T t=new T();来实例化 { //用反射来进行T的实例化 T o=(T)Activator.CreateI
阅读全文
摘要:1,反射获取程序集的三种方式 Assembly assenbly=Assembly.LoadFile()//这种只需要提供程序集的名称 Assembly assenbly=Assembly.LoadFile(Path)//这种需要程序集 的路径 Assembly assenbly=Assembly.
阅读全文
摘要:1,是否存在File.Exists("文件完整路径"); 2,新建并写入 继承IDispose接口的可以使用using来自动释放,不用Close和Dispose Using(StreamWrite sw=File.CreateText("文件完整路径")) { sw.Write("写入内容"); }
阅读全文

浙公网安备 33010602011771号