随笔分类 -  C# .net core

摘要:namespace Jx3KeyPress { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { /// <summary 阅读全文
posted @ 2023-04-10 15:42 87de海雷 阅读(114) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// Excel导出 /// </summary> public static class ExcelHelper { /// <summary> /// 设置表格样式 /// </summary> /// <param name="cell"></param> /// 阅读全文
posted @ 2023-03-23 10:19 87de海雷 阅读(81) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// decimal 转换中文大写 /// </summary> /// <param name="val"></param> /// <returns></returns> public static string ToRMB(this decimal val) { 阅读全文
posted @ 2021-08-26 16:53 87de海雷 阅读(90) 评论(0) 推荐(0) 编辑
摘要:public static string ToUrlParams(this object obj) { return string.Join("&", obj.GetType().GetProperties().Where(x => x.GetValue(obj)!= null).Select(x 阅读全文
posted @ 2021-08-26 15:48 87de海雷 阅读(369) 评论(0) 推荐(1) 编辑
摘要:打开 nuget管理器 搜索 PinYinConverterCore 安装 public static class Helper {public static string ToPinYin(this string val, bool first = false) { return string.J 阅读全文
posted @ 2021-08-26 15:18 87de海雷 阅读(670) 评论(0) 推荐(1) 编辑
摘要:public static T MapTo<T>(this object obj) { return new MapperConfiguration(x => x.CreateMap(obj.GetType(), typeof(T))).CreateMapper().Map<T>(obj); } 阅读全文
posted @ 2021-08-26 09:36 87de海雷 阅读(119) 评论(0) 推荐(0) 编辑
摘要:自己写Redis一键安装小工具 下载>>解压>> 安装服务>>卸载服务 源码:下载地址 阅读全文
posted @ 2021-08-11 12:15 87de海雷 阅读(62) 评论(0) 推荐(0) 编辑
摘要:这个是纯真ip库修改的3级库 顶级国家>省>市 ip存的为 int 类型 ip转int C# 代码 https://www.cnblogs.com/87duan/p/15039204.html 下载地址 IPAddress.rar 阅读全文
posted @ 2021-07-27 17:34 87de海雷 阅读(140) 评论(0) 推荐(0) 编辑
摘要:--读取成文本 var txt = System.IO.File.ReadAllText("1.txt"); --读取成逐行数组 string[] arr = System.IO.File.ReadAllLines("1.txt"); -- 没有文件会自动创建,有就追加 System.IO.File 阅读全文
posted @ 2021-07-27 16:26 87de海雷 阅读(1553) 评论(0) 推荐(0) 编辑
摘要:public string ToIPv4(int val) { return string.Join(".",BitConverter.GetBytes(val).Reverse()); } 阅读全文
posted @ 2021-07-27 16:20 87de海雷 阅读(67) 评论(0) 推荐(0) 编辑
摘要:Startup 文件 注册服务 public void ConfigureServices(IServiceCollection services){ services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); } 获取IP 阅读全文
posted @ 2021-07-22 11:36 87de海雷 阅读(506) 评论(0) 推荐(0) 编辑
摘要:DbContext.users.Where(x=>x.LastLogintime > DateTime.Now.AddDays(-(DateTime.Now - DateTime.Parse("2000-01-03")).Days % 7).Date) DateTime.Parse("2000-01 阅读全文
posted @ 2021-07-21 16:51 87de海雷 阅读(122) 评论(0) 推荐(0) 编辑
摘要:public void ConfigureServices(IServiceCollection services) { services.Scan(s => s.FromAssemblyOf<IService>().AddClasses().AsImplementedInterfaces().Wi 阅读全文
posted @ 2021-07-21 15:10 87de海雷 阅读(311) 评论(0) 推荐(0) 编辑
摘要:public static string Save(this IFormFile file) { var NewFileName = $"{Guid.NewGuid()}{Path.GetExtension(file.FileName)}"; var path = Path.Combine($"{D 阅读全文
posted @ 2021-07-21 15:01 87de海雷 阅读(724) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// ip转int /// </summary> /// <param name="ip">ip地址</param> /// <returns></returns> public int ToIPInt(string ip ) { return BitConverter 阅读全文
posted @ 2021-07-21 14:06 87de海雷 阅读(159) 评论(0) 推荐(0) 编辑
摘要:1 /// <summary> 2 /// MD5加密 3 /// </summary> 4 /// <param name="val"></param> 5 /// <returns></returns> 6 public string Md5(string val) 7 { 8 return s 阅读全文
posted @ 2021-07-21 14:04 87de海雷 阅读(203) 评论(0) 推荐(0) 编辑

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