随笔分类 -  C#

摘要:private void timer2_Tick(object sender, EventArgs e) { lbltime.Text = DateTime.Now.ToString(); if (DateTime.Now.Hour... 阅读全文
posted @ 2015-05-26 19:45 自由无风 阅读(1023) 评论(0) 推荐(0)
摘要:public static void Main(string[] args) { string s = GetMd5("123"); Console.WriteLine(s); Console.ReadK... 阅读全文
posted @ 2015-05-25 21:13 自由无风 阅读(200) 评论(0) 推荐(0)
摘要://声明父类 class ProductsFather { public double Price { get; set; } public int Count { ... 阅读全文
posted @ 2015-05-22 22:39 自由无风 阅读(253) 评论(0) 推荐(0)
摘要:class class1 { public static void Main(string[] args) { Person ps = new Person(); ps.KouLan(); IFlya... 阅读全文
posted @ 2015-05-22 21:39 自由无风 阅读(206) 评论(0) 推荐(0)
摘要:public sealed class Person:继承类名 { } 阅读全文
posted @ 2015-05-22 21:17 自由无风 阅读(328) 评论(0) 推荐(0)
摘要:public partial class Person { } public partial class Person { }partial修饰符,可以让同类命名空间下出现重名,两个类其实是一个类,用于多人协做时,类名的重复 阅读全文
posted @ 2015-05-22 21:14 自由无风 阅读(303) 评论(0) 推荐(0)
摘要:class class1 { public static void Main(string[] args) { //使用多态求矩形面积与周长和圆的面积与周长 Shape cl = new Circle(5); ... 阅读全文
posted @ 2015-05-20 21:28 自由无风 阅读(1519) 评论(0) 推荐(0)
摘要:public static void Main(string[] args) { double db = Math.PI; db = Math.Round(db,2); Console.WriteLine(db);... 阅读全文
posted @ 2015-05-20 20:59 自由无风 阅读(11023) 评论(0) 推荐(0)
摘要:1.抽象成员必须标记为abstract,并且不能有任何实现。2.抽象成员必须在抽象类中。3.抽象类不能被实例化4.子类继承抽象类后,必须把父类中的所有抽象成员都重写。(除非子类也是一个抽象类,则可以不重写)5.抽象成员的访问修饰符不能是private6.在抽象类中可以包含实例成员。并且抽象类的实例成... 阅读全文
posted @ 2015-05-20 20:14 自由无风 阅读(2950) 评论(0) 推荐(0)
摘要:class Class1 { static void Main(string[] args) { YuanGong yg = new YuanGong(); JingLi jl = new JingLi(); ... 阅读全文
posted @ 2015-05-19 23:12 自由无风 阅读(223) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { string source = @"D:\c\集合.avi"; string target = @"C:\Users\Administrator\Desktop\集合2.av... 阅读全文
posted @ 2015-05-18 23:14 自由无风 阅读(704) 评论(0) 推荐(0)
摘要:FileStream fsRead = new FileStream(@"C:\Users\Administrator\Desktop\u.html",FileMode.OpenOrCreate,FileAccess.Read); byte[] buffer = new ... 阅读全文
posted @ 2015-05-18 22:55 自由无风 阅读(821) 评论(0) 推荐(0)
摘要:Dictionary dc = new Dictionary(); dc.Add(1, "看了"); dc.Add(2, "没看"); dc.Add(3, "不知道"); dc[1] = "哈哈"; ... 阅读全文
posted @ 2015-05-17 22:32 自由无风 阅读(516) 评论(0) 推荐(0)
摘要://创建list泛型集合 List ilist = new List(); ilist.Add(1); ilist.Add(9); ilist.AddRange(new int[] { 23... 阅读全文
posted @ 2015-05-17 09:36 自由无风 阅读(687) 评论(0) 推荐(0)
摘要://创建文件 //File.Create(@"D:\a.txt"); //Console.WriteLine("创建成功"); ////删除文件 //File.Delete(@"D:\a.txt"); ... 阅读全文
posted @ 2015-05-17 09:25 自由无风 阅读(4716) 评论(0) 推荐(0)
摘要://Hashtable键值集合 键必须是维一的 类似于索引 Hashtable ht = new Hashtable(); ht.Add(1, "中国"); ht.Add(2, 123); ht.Add(... 阅读全文
posted @ 2015-05-16 20:45 自由无风 阅读(398) 评论(0) 推荐(0)
摘要:ArrayList list = new ArrayList(); Random rd = new Random(); for (int i = 0; i <10; i++) { int rNumbe... 阅读全文
posted @ 2015-05-16 20:08 自由无风 阅读(136) 评论(0) 推荐(0)
摘要:子类可以调用,但实例化的对像不可调用 new object; 阅读全文
posted @ 2015-05-16 19:44 自由无风 阅读(168) 评论(0) 推荐(0)
摘要:ArrayList alist = new ArrayList(); //集合对像 长度可以改变,类型不限 //添加单个元素可以Add() alist.Add("在在的"); alist.Add(35);... 阅读全文
posted @ 2015-05-16 18:54 自由无风 阅读(1362) 评论(0) 推荐(0)
摘要:Console.WriteLine("输入字符1"); string n1 = Console.ReadLine(); Console.WriteLine("输入字符2"); string n2 = Console.ReadLin... 阅读全文
posted @ 2015-05-14 21:36 自由无风 阅读(11838) 评论(0) 推荐(0)