摘要: 在JavaScript中,如果你有一个JSON字符串,并且你想通过GET请求或者其他HTTP请求来传递这个字符串,你可以使用encodeURIComponent函数来确保字符串能够安全地通过URL传输。 // 假设我们有一个JSON对象 const jsonObject = { name: "Joh 阅读全文
posted @ 2024-04-23 13:03 James·wang 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 一、通过NuGet安装IP2Region(支持Framework)如果是Net6则可以使用IP2Region.Net版本 1、IP2Region使用方式: using (DbSearcher search = new DbSearcher(CommonHelper.MapPath("/Resourc 阅读全文
posted @ 2024-04-18 15:32 James·wang 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 比如一个例子: 有一个字符串:pdf,jpg,png,jpge,doc,docx,xls,xlsx,ppt,pptx,rar,zip 把它修改成以逗号连接的扩展名字符串,方法如下: var accept="pdf,jpg,png,jpge,doc,docx,xls,xlsx,ppt,pptx,rar 阅读全文
posted @ 2024-04-14 09:23 James·wang 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 什么是Content-Type?Content-Type是HTTP协议中的一个头部字段,用于指示请求或响应中所传输的实体的媒体类型。 为什么使用Content-Type?使用Content-Type可以告知接收方如何解析和处理传输的数据,确保数据能够正确地被解析和处理。 Content-Type有哪 阅读全文
posted @ 2023-12-28 14:30 James·wang 阅读(1727) 评论(0) 推荐(0) 编辑
摘要: 使用Win+R调出运行,输入: 1️⃣ shell:startup 用户开机自启动(程序开机自启动只针对当前登录的用户)打开的目录为C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 阅读全文
posted @ 2023-12-04 12:09 James·wang 阅读(501) 评论(0) 推荐(0) 编辑
摘要: dataTable.Columns["Qty"].SetOrdinal(0); dataTable.Columns["Unit"].SetOrdinal(1); 扩展方法: public static class DataTableExtensions { public static void Se 阅读全文
posted @ 2023-11-11 22:22 James·wang 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 问题:先对数据进行时间倒序排列,然后再按照某字符分组,在每个分组内再按照某数字或字符正序排列 解答: var data=list.OrderByDescending(i => i.Date).ToList(); var gData = data.GroupBy(g => g.code).Select 阅读全文
posted @ 2023-11-03 11:22 James·wang 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1. 将json字符串转化为json对象 方案一:jquery自带的$.parseJSON函数 var jsonstr="{\"id\":\"1\",\"name\":\"jack\"}"; var obj=$.parseJSON(jsonstr); 说明:使用该方法对json字符串的要求比较高,属 阅读全文
posted @ 2023-09-13 10:53 James·wang 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1.Math.Round:四舍六入五取偶 Math.Round(17.475728155339805, 2, MidpointRounding.AwayFromZero)=17.48 Math.Round(0.0) //0Math.Round(0.1) //0Math.Round(0.2) //0M 阅读全文
posted @ 2023-09-12 11:46 James·wang 阅读(421) 评论(0) 推荐(0) 编辑
摘要: var data = db.Invoice.Select(i => new InvoiceVM { InvoiceId = i.InvoiceId, GroupIds = SqlFunctions.DateName("yyyy", i.BillDate )+"-"+SqlFunctions.Date 阅读全文
posted @ 2023-09-11 13:04 James·wang 阅读(71) 评论(0) 推荐(0) 编辑