随笔分类 -  C#

摘要:string FaPiaoUrl = ""; string FaPiaoImageUrl = ""; string HTMLSTR = NetTools.GetResponse(Dr["InvoiceUrl"].ToString()); string pattern = @"(?=http).*(? 阅读全文
posted @ 2024-01-18 13:40 亦承 阅读(63) 评论(0) 推荐(0) 编辑
摘要:public static void SaveLog(string LogMessage, int Level, string PreLogDir = "") { int LogLevel = 0; int.TryParse(ConfigurationManager.AppSettings["Log 阅读全文
posted @ 2024-01-08 11:32 亦承 阅读(133) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 加载邮件模板 /// </summary> /// <param name="TempPath">C:\Users\Administrator\Documents\模板.html</param> /// <param name="Params">模板参数</par 阅读全文
posted @ 2024-01-08 11:30 亦承 阅读(11) 评论(0) 推荐(0) 编辑
摘要:Redis的下载地址:https://github.com/MicrosoftArchive/redis/releases/tag/win-3.2.100 进入解压后的文件夹,输入命令 redis-server redis.windows.conf 后回车,如下即表示启动成 功 在redis文件夹下 阅读全文
posted @ 2022-11-08 11:25 亦承 阅读(33) 评论(0) 推荐(0) 编辑
摘要:protected override void HandleUnauthorizedRequest(HttpActionContext filterContext) { base.HandleUnauthorizedRequest(filterContext); var response = fil 阅读全文
posted @ 2022-11-08 11:17 亦承 阅读(189) 评论(0) 推荐(0) 编辑
摘要:实现需求:验证Token是否有效,重写状态码和返回内容 /// <summary> /// 权限过滤器,验证Token是否有效 /// </summary> /// <param name="filterContext"></param> protected override void Handle 阅读全文
posted @ 2022-11-08 11:16 亦承 阅读(174) 评论(0) 推荐(0) 编辑
摘要:网上找了好多文章都没有准确的操作word表格换行的操作,参考网上文章摸索了一天的成果记录一下。 一、word表格,注意要设置表格高度自动 二、代码 public static void CreateWoedFile() { try { string temp_path = AppDomain.Cur 阅读全文
posted @ 2022-03-08 11:21 亦承 阅读(795) 评论(0) 推荐(0) 编辑
摘要:一、添加引用 using System.Data.OleDb; 二、创建CustomExecutingFilterAttribute public class CustomExecutingFilterAttribute: Attribute { public string Title { get; 阅读全文
posted @ 2022-03-07 10:40 亦承 阅读(939) 评论(0) 推荐(0) 编辑
摘要:注:此功能依托于NPOI,需要引用NPOI包。 /// <summary> /// 将List转化为Excel /// </summary> /// <typeparam name="T">类型</typeparam> /// <param name="source">数据源</param> /// 阅读全文
posted @ 2022-03-07 10:21 亦承 阅读(142) 评论(0) 推荐(0) 编辑
摘要:一、创建一个用户自定义表类型 CREATE TYPE [dbo].[Excel_HsCode] AS TABLE( [material_no] [varchar](100) NULL, [oldhs_code] [varchar](100) NULL, [newhs_code] [varchar]( 阅读全文
posted @ 2021-10-29 15:26 亦承 阅读(148) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Linq; using System.Text; using System.Thr 阅读全文
posted @ 2021-10-29 15:12 亦承 阅读(1456) 评论(0) 推荐(0) 编辑
摘要:using System; using System.IO; namespace ConsoleApp4.Extensions { public class Logger { private static object obj = new object(); /// <summary> /// 将日 阅读全文
posted @ 2021-10-29 11:19 亦承 阅读(190) 评论(0) 推荐(0) 编辑
摘要:一、首先运行命令安装NuGet包:(使用命令行可以避免一些NuGet包版本兼容问题) 1、Install-Package Microsoft.EntityFrameworkCore 2、Install-Package Microsoft.EntityFrameworkCore.SqlServer 二 阅读全文
posted @ 2021-10-29 11:13 亦承 阅读(1418) 评论(0) 推荐(0) 编辑
摘要:using Fast.NetCore.Web.Extend; using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Linq; using System.Web; n 阅读全文
posted @ 2021-10-22 16:50 亦承 阅读(117) 评论(0) 推荐(0) 编辑
摘要:using Microsoft.AspNetCore.Http; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Fast.NetCo 阅读全文
posted @ 2021-10-22 16:49 亦承 阅读(320) 评论(0) 推荐(0) 编辑
摘要:using Fast.NetCore.Web.Interface; using Newtonsoft.Json; using StackExchange.Redis; using System; using System.Collections.Generic; using System.Linq; 阅读全文
posted @ 2021-10-22 16:47 亦承 阅读(689) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; 阅读全文
posted @ 2021-10-22 16:31 亦承 阅读(1764) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpr 阅读全文
posted @ 2021-10-22 16:18 亦承 阅读(372) 评论(0) 推荐(0) 编辑
摘要:private static readonly object Obj_Lock = new object(); public static string GetUserName() { lock (Obj_Lock) { return "张三"; } } 阅读全文
posted @ 2021-10-22 16:09 亦承 阅读(329) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示