06 2024 档案

摘要:方法一:使用Math.Round()函数 double number = 3.14159;double result = Math.Round(number, 2); // 四舍五入保留两位小数Console.WriteLine(result); // 输出: 3.14 方法二:使用Math.Flo 阅读全文
posted @ 2024-06-26 15:04 乐 乐——1128 阅读(161) 评论(0) 推荐(0) 编辑
摘要:1 public class BaseController : ControllerBase 2 { 3 public static string TIME_FORMAT_FULL = "yyyy-MM-dd HH:mm:ss"; 4 5 /// <summary> 6 /// 返回成功封装 7 / 阅读全文
posted @ 2024-06-24 15:26 乐 乐——1128 阅读(7) 评论(0) 推荐(0) 编辑
摘要:1 public class ComputerHelper 2 { 3 /// <summary> 4 /// 内存使用情况 5 /// </summary> 6 /// <returns></returns> 7 public static MemoryMetrics GetComputerInf 阅读全文
posted @ 2024-06-24 15:17 乐 乐——1128 阅读(7) 评论(0) 推荐(0) 编辑
摘要:1 /// <summary> 2 /// SQL条件拼接 3 /// </summary> 4 /// <param name="str"></param> 5 /// <param name="condition"></param> 6 /// <returns></returns> 7 pub 阅读全文
posted @ 2024-06-24 15:12 乐 乐——1128 阅读(4) 评论(0) 推荐(0) 编辑
摘要:1 public static partial class Extensions 2 { 3 #region 枚举成员转成dictionary类型 4 /// <summary> 5 /// 转成dictionary类型 6 /// </summary> 7 /// <param name="enu 阅读全文
posted @ 2024-06-24 15:06 乐 乐——1128 阅读(4) 评论(0) 推荐(0) 编辑
摘要:1 public class FileUtil 2 { 3 /// <summary> 4 /// 按时间来创建文件夹 5 /// </summary> 6 /// <param name="path"></param> 7 /// <returns>eg: /{yourPath}/2020/11/ 阅读全文
posted @ 2024-06-24 15:01 乐 乐——1128 阅读(4) 评论(0) 推荐(0) 编辑
摘要:需要引入UAParser,IPTools.Core类库a 1 public static partial class HttpContextExtension 2 { 3 /// <summary> 4 /// 是否是ajax请求 5 /// </summary> 6 /// <param name 阅读全文
posted @ 2024-06-22 13:36 乐 乐——1128 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1 public static partial class Extensions 2 { 3 #region 转换为long 4 /// <summary> 5 /// 将object转换为long,若转换失败,则返回0。不抛出异常。 6 /// </summary> 7 /// <param na 阅读全文
posted @ 2024-06-22 11:44 乐 乐——1128 阅读(2) 评论(0) 推荐(0) 编辑
摘要:1 public class HttpHelper 2 { 3 /// <summary> 4 /// 发起POST同步请求 5 /// </summary> 6 /// <param name="url"></param> 7 /// <param name="postData"></param> 阅读全文
posted @ 2024-06-22 11:24 乐 乐——1128 阅读(37) 评论(0) 推荐(0) 编辑
摘要:1 public class DateTimeHelper 2 { 3 /// <summary> 4 /// 5 /// </summary> 6 /// <param name="dateTime"></param> 7 /// <returns></returns> 8 public stat 阅读全文
posted @ 2024-06-22 11:14 乐 乐——1128 阅读(7) 评论(0) 推荐(0) 编辑
摘要:public static class JsonHelper { /// <summary> /// 将对象序列化为JSON格式 /// </summary> /// <param name="o">对象</param> /// <returns>json字符串</returns> public s 阅读全文
posted @ 2024-06-22 10:58 乐 乐——1128 阅读(5) 评论(0) 推荐(0) 编辑

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