04 2018 档案
摘要:1 public class MyFile 2 {//文件长度 3 private float fileLength; 4 5 public float FileLength 6 { 7 get { return fileLength; } 8 set { fileLen...
阅读全文
摘要:1 //频道基类 2 public abstract class ChannelBase 3 { 4 //频道名称 5 public string ChannelName { get; set; } 6 //频道路径 7 public string Path { get; set; } ...
阅读全文
摘要:1 public class SE:Employee 2 { 3 private int popularity; 4 public int Popularity 5 { 6 get { return popularity; } 7 set { popularity = valu...
阅读全文
摘要:1 public class HealItem 2 { 3 //检查项目 4 private string name;//项目名 5 public string Name 6 { 7 get { return name; } 8 set { name = va...
阅读全文
摘要:public class order//菜单类 2 { 3 public Client customer;//顾客 4 public int id;//餐桌号 5 public string mealList;//点的菜单 6 } 1 public class Client//顾客类 2 { 3 //点餐...
阅读全文
摘要:public class SE { public string Id { get; set; } public int Age { get; set; } public string Name { get; set; } public string Gender { get; set; } } publi...
阅读全文
摘要:1 public class SE 2 { 3 //员工类 4 private int id; 5 6 public int Id 7 { 8 get { return id; } 9 set { id = value; } 10 } 11 ...
阅读全文
摘要:public class LoginInfo { /// /// 用户信息类 /// private string email; public string Email { get { return email; } set { email = va...
阅读全文
摘要:1.开闭原则(Open Close Principle)定义:一个软件实体如类、模块和函数应该对扩展开放,对修改关闭。 开放-封闭原则的意思就是说,你设计的时候,时刻要考虑,尽量让这个类是足够好,写好了就不要去修改了,如果新需求来,我们增加一些类就完事了,原来的代码能不动则不动。这个原则有两个特性,
阅读全文
摘要:自定义控件 步骤:1.对项目点击右键 >新建用户控件 2.让它继承自想要重写的微软空间(eg.TextBox) 3.设置好属性后,点击项目 >右键 >重新生成 4.切回窗体,打开工具箱,发现当前项目在工具箱中开了一个选项卡 5.拖动控件到窗体上即可,和使用普通控件就一样了
阅读全文
摘要:继承:是使用已存在的类的定义作为基础建立新类的技术 1.1 base关键字(表示父类,可以访问父类的成员) eg: public Child() { } public Child(int age2, string name2,string homeAddress ):base(name2,age2)
阅读全文
摘要:public FrmShow() { InitializeComponent(); this.Init();//初始化员工信息 this.UpdateView();//将员工信息绑定到listView1上 } //准备一个容器,可以容纳3个员工对象 SE[] engineers = new SE[3
阅读全文
摘要:集合:某些指定的对象集中在一起1.ArrayList使用(1)非泛型集合 引入命名空间System.Collection;(2)Add(object):将对象添加到ArrayList结尾处;(3)RemoveAt(int index):移除ArrayList指定索引处的元素;(4)Remove(ob
阅读全文
浙公网安备 33010602011771号