上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 19 下一页
摘要: Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06 Select CONVERT(varchar(100), GETDA 阅读全文
posted @ 2021-04-09 13:08 PrintY 阅读(108) 评论(0) 推荐(0)
摘要: 1 -如果存在则删除原有函数 2 IF OBJECT_ID(N'dbo.RegexReplace') IS NOT NULL 3 DROP FUNCTION dbo.RegexReplace 4 GO 5 --开始创建正则替换函数 6 CREATE FUNCTION dbo.RegexReplace 阅读全文
posted @ 2021-03-11 20:38 PrintY 阅读(1171) 评论(0) 推荐(0)
摘要: 首先切换到redis根目录 >> redis-cli.exe -h 127.0.0.1 -p 6379 >>config get requirepass >>config set requirepass 123456 这个时候连接redis会提示:Redis (error) NOAUTH Authe 阅读全文
posted @ 2021-03-11 13:37 PrintY 阅读(71) 评论(0) 推荐(0)
摘要: Extension MIME Type.doc application/msword.dot application/msword .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document.dotx a 阅读全文
posted @ 2021-03-10 14:36 PrintY 阅读(451) 评论(0) 推荐(0)
摘要: .net5发布和.net core3发布一样,没有什么区别,就不多说了,之前我也发过教程,.net5 webapi 默认集成了Swagger ,发布的时候 发现swagger没有了.... 这个问题需要是Startup.cs文件中Configure方法的问题,把swagger从IsDevelopme 阅读全文
posted @ 2021-01-25 11:49 PrintY 阅读(1279) 评论(1) 推荐(1)
摘要: 认证和授权区别? 首先我们要弄清楚认证(Authentication)和授权(Authorization)的区别,以免混淆了。认证是确认的过程中你是谁,而授权围绕是你被允许做什么,即权限。显然,在确认允许用户做什么之前,你需要知道他们是谁,因此,在需要授权时,还必须以某种方式对用户进行身份验证。 什 阅读全文
posted @ 2021-01-22 13:39 PrintY 阅读(3087) 评论(2) 推荐(2)
摘要: 1 public class APIAuthFilter : Attribute, IAuthorizationFilter 2 { 3 private const string secretKey = ""; 8 public void OnAuthorization(AuthorizationF 阅读全文
posted @ 2021-01-22 11:53 PrintY 阅读(807) 评论(0) 推荐(0)
摘要: 1、修改Startup.cs文件 2、中间件件注 app.UseAuthorization(); 4、效果 5、代码如下: 1 public void ConfigureServices(IServiceCollection services) 2 { 3 services.AddControlle 阅读全文
posted @ 2021-01-22 11:42 PrintY 阅读(558) 评论(0) 推荐(0)
摘要: 正常来说.net5 的webapi项目,默认已经有swagger了,但是我发现方法体注释说明显示不出来,这里主要是解决这个问题。 首先改下xml输出路径 然后在Startup.cs中添加几行代码 1 //Locate the XML file being generated by ASP.NET.. 阅读全文
posted @ 2021-01-21 08:57 PrintY 阅读(1286) 评论(0) 推荐(0)
摘要: 1、NuGet安装 Microsoft.AspNetCore.Http 2、services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); 3、获取 1 HttpContextAccessor context = new Htt 阅读全文
posted @ 2021-01-20 13:45 PrintY 阅读(1049) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 19 下一页