C#
文章平均质量分 53
小鲨鱼92
这个作者很懒,什么都没留下…
展开
-
C#中的Char类
Char类是System中的一个类成员。表示一个 Unicode 字符。Char类中的方法:static方法:static方法中大部分有2个重载,一个是仅有一个参数char,另外一个是有两个参数string和int用来获取string中的某一个字符1.public static string ConvertFromUtf32(int utf32)给定一个Unicode数值,返回所对应的char类型...原创 2018-01-04 14:42:21 · 3927 阅读 · 1 评论 -
C#中的类型转换
C#中的类型转换隐式类型转换:在赋值时进行自动转换窄类型转换为宽类型显示类型转换:在赋值时要用括号转换宽类型转换为窄类型有时候会有数据丢失注:数值只能转换为:数字,char,enumBoolean不支持转换字符串转换为相应类型用Convert类进行转换(Convert.ToInt32(“XXX”))其他类型转换为string用ToString()方法原创 2018-01-08 16:04:04 · 186 阅读 · 0 评论 -
C#中的枚举
C#中的枚举类型(基本)定义:Enum 枚举名 :基本数据类型{枚举成员1 = 0,枚举成员2 = 1,... ...} 赋值:枚举类型 变量名 =枚举类型.枚举成员1; Enum类: public static string GetName(System.Type enumType,object value)System.Typ原创 2018-01-08 16:06:59 · 240 阅读 · 0 评论 -
C#中的时间类
DateTime&TimeSpanDateTime类表示时间上的一刻,通常以日期和当天的时间表示。构造方法:public DateTime(int,int,int) 创建指定年月日的时间对象,重载有多个方法,可以创建具有年月日时分秒的时间对象public static int DaysInMonth(int year, int month) 返回指定年份月份的天数p原创 2018-01-20 13:26:16 · 3439 阅读 · 0 评论