随笔分类 - C#
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Drawing; usin
阅读全文
摘要:C#关键词default函数,default(T)可以得到该类型的默认值. C#在类初始化时,会给未显示赋值的字段、属性赋上默认值,但是值变量却不会。 值变量可以使用默认构造函数赋值,或者使用default(T)赋值。 默认构造函数是通过 new 运算符来调用的,如下所示: int myInt =
阅读全文
摘要:网上找了很多,都讲的不明白。最后看了官网总结了一下 https://docs.microsoft.com/zh-tw/previous-versions/windows/silverlight/dotnet-windows-silverlight/s4wyw1wh(v=vs.95) 计算某一天属于当
阅读全文
摘要:预定义特性(Attribute) .Net 框架提供了三种预定义特性: AttributeUsage Conditional Obsolete AttributeUsage 预定义特性 AttributeUsage 描述了如何使用一个自定义特性类。它规定了特性可应用到的项目的类型。 规定该特性的语法
阅读全文
摘要://利用反射实现深拷贝 public static T DeepCopyByReflection<T>(this T tSource) { T tResult = Activator.CreateInstance<T>(); Type sourceType = typeof(T); Type res
阅读全文
摘要:using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace J
阅读全文
摘要:前台 encodeURIComponent(newVal) 后台 Request.QueryString["MACHINECODE"]; 可以正常显示+ 号
阅读全文

浙公网安备 33010602011771号