307down votefavorite 93 Do you know a fast and simple way to encode a Javascript Object into a string that I can pass via a GET Request? No jQuery, no other frameworks - just plain Javascript :) javascript query-string urlencode shareimprove this que…
在C#中,枚举用来定状态值很方便,例如我定义一个叫做Season的枚举 public enum Season { Spring = 1, Summer = 2, Autumn = 3, Winter = 4 } 枚举名是不能出现空格,()-/等字符 我们想把Spring显示为春天,我们要自己定义说明信息,我们可以使用DescriptionAttribute,如下 public enum Season { [Description("春 天")] Spring = 1, [Descrip…
using System; using System.Data; namespace Sunlib { public static class DataHelper { //将数据库数据对象转换为实体值对象 //T:要转换的类型 //columnName:列名 //defValue:默认值 public static T ToValue<T>(DataRow dr, string columnName,T defValue) { if(dr.Table.Columns.Contains(col…