诗情寻知己
揽几缕、轻挽起,暮暮朝朝与君语。
随笔 - 39,  文章 - 3,  评论 - 4,  阅读 - 30754

随笔分类 -  C#

DESCryptoServiceProvider 加密解密
摘要:public static class Extend { //注意:这里的密钥sKey必须能转为8个byte,即输入密钥为8半角个字符或者4个全角字符或者4个汉字的字符串 public static string strKey = "bingTest"; public static string s 阅读全文
posted @ 2023-06-08 17:00 诗情寻知己 阅读(418) 评论(0) 推荐(0) 编辑
面试记录1
摘要:static void Main(string[] args) { int j = 0; Console.WriteLine("++ j =>" + (++j)); //++ j => 1 int s = 0; Console.WriteLine("s++ =>" + (s++)); //s++ = 阅读全文
posted @ 2023-04-18 15:52 诗情寻知己 阅读(13) 评论(0) 推荐(0) 编辑
Net Core 5.0 MVC 使用Aspose.Cells 解析数据
摘要:控制器添加内容 public class BookingController : BaseController { private readonly IBookingService _bookingService; private readonly IHostingEnvironment _host 阅读全文
posted @ 2023-02-01 10:59 诗情寻知己 阅读(98) 评论(0) 推荐(0) 编辑
HttpPost 帮助类
摘要:1 public static class ClientHelper 2 { 3 public static string HttpPost(string url, string content) 4 { 5 string result = string.Empty; 6 try 7 { //在.n 阅读全文
posted @ 2022-10-10 14:05 诗情寻知己 阅读(36) 评论(0) 推荐(0) 编辑
.net 5 linq groupby sum
摘要:var query = from h in _repository.Context.Set<TbCapcity>().Where(e => e.IsActive == true) join l in _repository.Context.Set<TbLocation>().Where(e => e 阅读全文
posted @ 2022-08-17 17:16 诗情寻知己 阅读(89) 评论(0) 推荐(0) 编辑
字符串中不符合xml格式的字符过滤
摘要:str = Regex.Replace(str, "[\x00-\x08\x0b\x0c\x0e-\x1f\x26]", "") 阅读全文
posted @ 2022-07-19 18:33 诗情寻知己 阅读(29) 评论(0) 推荐(0) 编辑
几行代码解决实体转XMl出现Unicode字符转换异常问题
摘要:Vb.Net Dim info As 实体类型=new 实体类型() Dim info_str As String = JsonConvert.SerializeObject(ert) info_str = Regex.Replace(info_str, "\\[u|U][a-f0-9]{4,8}" 阅读全文
posted @ 2022-07-19 18:20 诗情寻知己 阅读(95) 评论(0) 推荐(0) 编辑
asp.net api 下载文件与.net 5.0 下载文件
摘要:1.asp.net api 下载文件 [HttpGet] public HttpResponseMessage DownFile(string fileName) { try { string filefullPath = Path.Combine(System.Web.HttpContext.Cu 阅读全文
posted @ 2022-06-04 17:13 诗情寻知己 阅读(240) 评论(0) 推荐(0) 编辑
C# 清空文件夹内容
摘要:1 /// <summary> 2 /// 清空文件夹 3 /// </summary> 4 /// <param name="filefullPath">文件夹路径</param> 5 /// <param name="FileExpirationTime">过期时间</param> 6 priv 阅读全文
posted @ 2022-06-04 16:56 诗情寻知己 阅读(1450) 评论(0) 推荐(0) 编辑
Net Core 5.0 Windows服务形式打包
摘要:.net 5 Windows服务形式打包 1、为了将应用转换成Windows服务,我们需要引入一个包,如下: Microsoft.Extensions.Hosting.WindowsServices 引用方式有以下两种比较方便的形式: 使用NuGet包管理器,在浏览中输入“Microsoft.Ext 阅读全文
posted @ 2022-05-17 14:52 诗情寻知己 阅读(378) 评论(0) 推荐(0) 编辑
发布问题记录--1
摘要:1.IIS上部署网站,打开后ExtensionlessUrlHandler-Integrated-4.0解决办法 以管理员运行下面的命令注册: 32位机器: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i 64位机 阅读全文
posted @ 2021-11-22 11:08 诗情寻知己 阅读(35) 评论(0) 推荐(0) 编辑
Aspose.Words插入表格,表格居中显示
摘要:Aspose.Words.Tables.Table table = builder.StartTable(); builder.InsertCell(); builder.Write("表头1"); builder.InsertCell(); builder.Write("表头2"); builde 阅读全文
posted @ 2021-11-19 10:26 诗情寻知己 阅读(1376) 评论(0) 推荐(0) 编辑
C# 中使用Aspose.Words下载文档
摘要:MVC中使用方式: 1.前端js调用受到限制,简单的方式有:window.location.href = url; 或者 window.open(url);访问控制器中的方法 2,后台使用代码: //方式一 public ActionResult NewGenerate(bool wordDoc) 阅读全文
posted @ 2021-11-09 15:41 诗情寻知己 阅读(303) 评论(0) 推荐(0) 编辑
添加 Azure Active Directory 服务,调用方法
摘要:引入dll :Microsoft.IdentityModel.JsonWebTokens 代码如下: 1 try 2 { 3 context.Response.ContentType = "text/plain"; 4 var codestr = context.Request["code"]; 5 阅读全文
posted @ 2021-06-24 17:18 诗情寻知己 阅读(122) 评论(0) 推荐(0) 编辑
Net Core 5.0 部署IIS错误-500.31-Failed to load ASP.NET Core runtime
摘要:Windows Server 2008 R2不支持.net core 3.0版本及以后更新的各个版本。 面对如上图提示,第一想到的就是服务器安装的SDK或者hosting版本有问题,第一时间检查了安装包版本,如下图: 都是当前最新版本,没有问题。 接着查看发布包是否在服务器中是否可以使用.EXE文件 阅读全文
posted @ 2021-06-09 10:19 诗情寻知己 阅读(8336) 评论(4) 推荐(0) 编辑
生成验证码及调用
摘要://创建验证码 public static string CreateValidateCode() { string checkCode = string.Empty; Random rnd = new Random(DateTime.Now.Millisecond); char[] chr = { 阅读全文
posted @ 2020-12-07 15:19 诗情寻知己 阅读(83) 评论(0) 推荐(0) 编辑
C#中使用swagger小技巧
摘要:C#中使用swagger小技巧 swaggerUI显示的接口内容主要用于开发阶段便于与前端联调,不适合发布到对外的站点。 有以下两种方式,让接口不显示在SwaggerUI中 1.使用属性 [ApiExplorerSettings(IgnoreApi = true)]设置接口不显示到swaggerUI 阅读全文
posted @ 2020-09-03 11:33 诗情寻知己 阅读(3782) 评论(0) 推荐(2) 编辑


< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示