摘要:
序列化对象 public class People { [XmlAttribute("NAME")] public string Name { set; get; } [XmlAttribute("AGE")] public int Age { set; get; } } [XmlRoot("Root")] public class Student : People { [XmlElement("CLASS")] public string Class { set; get; } [XmlElement(" 阅读全文
随笔分类 - C#基础
C# IL语法
2013-05-23 10:41 by 追梦网络, 1384 阅读, 收藏, 编辑
摘要:
操作码 作用add, sub, mul, div, rem 用于两个数加减乘除求模add, or, not, xor 用于在两个值上进行二进制操作ceq, cgt, clt用不同的方法比较两个在栈上的值,ceq:是否相等;cgt:是否大约;clt:是否小于box, unbox 在引用类型和值类型之间转换ret 退出方法和返回一个值beq, bgt, ble, blt, switch 控制方法中的条件分支,beg:如果相等就中止到代码标签;bgt:如果大于就中止到代码标签; ble:如果小于等于就中止到代码标签;blt:如果小于就中止到代码标签; 所有的分支控制操作码都需要给出一个CIL代码标签 阅读全文
C# Dictionary 的几种遍历方法
2013-01-22 14:59 by 追梦网络, 715 阅读, 收藏, 编辑
摘要:
Dictionary<string,int> list =newDictionary<string,int>(); list.Add("d", 1);//3.0以上版本foreach(variteminlist) {Console.WriteLine(item.Key + item.Value); }//KeyValuePair<T,K>foreach(KeyValuePair<string,int> kvinlist) {Console.WriteLine(kv.Key + kv.Value); }//通过键的集合取fore 阅读全文
dateTimePicker时间格式的自定义
2012-08-10 16:42 by 追梦网络, 904 阅读, 收藏, 编辑
摘要:
dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;dateTimePicker1.CustomFormat = "yyyy-MM-dd HH:mm:ss";参考:格式模式 说明 (源于网上)d 月中的某一天。一位数的日期没有前导零。dd 月中的某一天。一位数的日期有一个前导零。ddd 周中某天的缩写名称,在 AbbreviatedDayNames 中定义。dddd 周中某天的完整名称,在 DayNames 中定义。M 月份数字。一位数的月份没有前导零。MM 月份数字。一位数的月 阅读全文
向Combox控件中添加数据
2012-08-08 15:15 by 追梦网络, 838 阅读, 收藏, 编辑
摘要:
List<KeyValuePair<object, string>> dit = new List<KeyValuePair<object, string>>(); dit.Add(new KeyValuePair<object, string>(1, "测试操作类型")); dit.Add(new KeyValuePair<object, string>(2, "操作类型")); this.cbxMethod.DataSource = dit; this.cbxMethod.Dis 阅读全文
C# List<T>用法
2012-08-07 09:56 by 追梦网络, 207 阅读, 收藏, 编辑
摘要:
C# List<T>用法所属命名空间:System.Collections.GenericpublicclassList<T> :IList<T>,ICollection<T>,IEnumerable<T>,IList,ICollection,IEnumerableList<T>类是ArrayList类的泛型等效类。该类使用大小可按需动态增加的数组实现IList<T>泛型接口。泛型的好处:它为使用c#语言编写面向对象程序增加了极大的效力和灵活性。不会强行对值类型进行装箱和拆箱,或对引用类型进行向下强制类型转换, 阅读全文
C#操作Office实例
2012-07-08 23:52 by 追梦网络, 3543 阅读, 收藏, 编辑
摘要:
Microsoft Office是微软公司推出的办公应用程序,主要包括Microsoft Word,Microsoft Excel、Microsoft Outlook和Microsoft Access等应用程序。提供了诸如字处理、表格处理、邮件处理和数据库等功能。目前被广泛使用的版本是Microso 阅读全文