摘要: 1 阅读全文
posted @ 2021-07-02 16:58 風飄絮℃ 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 打个签,后续整理更新 阅读全文
posted @ 2021-06-09 17:31 風飄絮℃ 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 在Startup进行注册组件调整实现跨域 1、在Startup定义个变量用作策略名称(名称自定义) readonly string myAllowOrigins = "_myAllowOrigins"; 2、在服务里添加策略(如果要指定域名用WithOrigins) services.AddCors 阅读全文
posted @ 2021-06-07 11:20 風飄絮℃ 阅读(189) 评论(0) 推荐(0) 编辑
摘要: HttpClient的帮助类 public class HttpHelper { /// <summary> /// 发起POST同步请求 /// </summary> /// <param name="url"></param> /// <param name="postData"></param 阅读全文
posted @ 2019-12-31 15:25 風飄絮℃ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { if (args != null && args.Length > 11) { try { inputmo... 阅读全文
posted @ 2019-10-14 16:29 風飄絮℃ 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 出现如上的错误,是因为从ASP.NET Core 3.1开始,默认使用了微软内置的JSON序列化和反序列化类库:System.Text.Json,此类库中并没有像Json.NET中实现这些特殊数据类型的JSON转换,所以如果遇到这个问题: 1、可以手动安装 Json.NET 这替换 System.T 阅读全文
posted @ 2019-09-27 16:49 風飄絮℃ 阅读(2938) 评论(1) 推荐(1) 编辑
摘要: 读取 appsettings.json 相关配置 1、appsettings.json如下 { "Logging": { "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" }, 阅读全文
posted @ 2019-09-27 15:27 風飄絮℃ 阅读(3524) 评论(2) 推荐(0) 编辑
摘要: 在排除了代码的问题后,如 Domain 不一致,过期时间是基于当前时间增加过期时效的。 在排查返回请求时发现是过期时间的问题,设置的过期时间(Expire)小于请求的时间(Date)时,浏览器就会写不入。 然而 过期时间 小于 请求时间 是由于 IIS 与 http service 问题造成的。 解 阅读全文
posted @ 2019-09-27 15:00 風飄絮℃ 阅读(1736) 评论(0) 推荐(0) 编辑
摘要: //判断是否有管理者权限 WindowsPrincipal principal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); if (!principal.IsInRole(WindowsBuiltInRole.Administrator 阅读全文
posted @ 2019-08-07 09:56 風飄絮℃ 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 1、批量生成删表语句 select 'drop table '+b.name+'.'+a.name+';' from sys.tables a left join sys.schemas b on a.schema_id=b.schema_id //包含表架构 2、Sqlserver with 递归 阅读全文
posted @ 2019-07-08 08:52 風飄絮℃ 阅读(2268) 评论(0) 推荐(0) 编辑