一般项目中我们经常用到数据Json的序列化与反序列化,为了方便在需要的地方快速使用,一般建议都封装为静态扩展方法,在需要的地方可直接使用. 而目前C#项目中序列化一般都是用的 Newtonsoft.Json 来做的,因此这里贴出通用静态扩展方法供大家参考. PS:若要添加此扩展方法,必须得在Nuget包中添加 Newtonsoft.Json 的引用. using System; using System.Collections.Generic; using System.Text; usin…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CS扩展 { class Program { static void Main(string[] args) { Dictionary<int, int> myDic = new Dictionary<int, int>(); myD…
1.项目的运行环境 linux版本 [root@localhost ~]# cat /proc/version Linux version -.el6.x86_64 (mockbuild@x86-.build.eng.bos.redhat.com) (gcc version (Red Hat -) (GCC) ) # SMP Tue Jan :: EST jdk版本 [root@localhost ~]# java -version openjdk version "1.8.0_171"…
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Web; using System.Web.Routing; namespace WebClientService.Modules { public class GateKeeperOfStaticHtml : IHttpModule { // Fields private stat…
我们可以在Eclipse中新建一个Dynamic Web Project,然后在项目的WebContent目录下新建一个Html文件page1.html,其内容如下: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>page1</title> </head> <body> A Normal Html Page! <…