随笔分类 - C#
摘要:/// <summary> /// 生成指定位数的随机字符串 /// </summary> /// <param name="length"></param> /// <returns></returns> public static string GenerateRandomString(int
阅读全文
摘要:分组方法DynamicLinqExtensions: /// <summary> /// 动态构建分组表达式 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="propertyNames">上限最大7个元素</p
阅读全文
摘要:动态分组: public static class DynamicLinqExtensions { /// <summary> /// 分组查询 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source">
阅读全文
摘要:/// <summary> /// 比较当前byte数组与另一数组是否相等。 /// </summary> /// <param name="obj"></param> /// <param name="target">需要比较的数组。</param> /// <returns></returns>
阅读全文
摘要:生成唯一long类型自增Id: using System; namespace ConsoleApp1 { public static class Snowflake { static SnowflakeTool idworker = new SnowflakeTool(1); public sta
阅读全文
摘要:using Microsoft.AspNetCore.Mvc; using Net5ApiDemo.Common; using System; using System.Drawing; using System.IO; namespace Net5ApiDemo.Controllers { [Ro
阅读全文
摘要:q参考:https://blog.csdn.net/huwei2003/article/details/79882353
阅读全文
摘要:/// <summary> /// 转化工具类 /// </summary> public class GPSTransToAMap { //椭球参数 static double pi = 3.14159265358979324; static double a = 6378245.0; static double ee = 0.00669342162296594323; /// <summary
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace Siia.Veima.Host.Uti...
阅读全文
摘要:public class CacheHelper { //缓存容器 private static Dictionary CacheDictionary = new Dictionary(); /// /// 添加缓存 /// public static void Add(string k...
阅读全文
摘要:HttpGet: HttpPost:
阅读全文
摘要:/// /// 单例模式的实现 /// public class Singleton { // 定义一个静态变量来保存类的实例 private static Singleton uniqueInstance; // 定义一个标识确保线程同步 private static readonly obj...
阅读全文
摘要:using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; namespace report.Utils { public class WeChatHelper {...
阅读全文
摘要:#region 生成随机数 /// /// /// private static int iCount; /// /// 生成随机数 /// /// public static string GenerateRandomNumber() ...
阅读全文
摘要:R代表目标实体 T代表数据源实体
阅读全文
摘要:第一步:Log4net的安装 Install-Package log4net 第二步:Log4net的配置 log4net.config 第三步:创建LogHelper类 第四步:调用
阅读全文
摘要:using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Web; namespace Si...
阅读全文
摘要:新建项目后必须引用MvcPager.dll 注意引用4.0+版本以上哦 分页控制器 using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.
阅读全文
摘要:可以动态切换多个版本的语言,使用资源文件实现 1、新建LanguageHelper.cs 类 using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System
阅读全文