小颖传奇1.76特色服

散人公益,自由交易,

   ::  ::  ::  ::  :: 管理

2009年4月18日

摘要: 1. list类控件(DropDownList ListBox1 CheckBoxList1 RadioButtonList1 BulletedList1)ListItem表示其中一项的实例 绑定: x.DataSource = d3.Tables[0]; x.DataTextField = "username"; x.DataValueField = "id"; x... 阅读全文
posted @ 2009-04-18 10:24 xymir 阅读(130) 评论(0) 推荐(0)

摘要: protected void Button3_Click(object sender, EventArgs e) { int i=0; foreach (ListItem li in CheckBoxList1.Items) { if (li.Selected) ... 阅读全文
posted @ 2009-04-18 10:23 xymir 阅读(147) 评论(0) 推荐(0)

摘要: DropDownList ListBox1 CheckBoxList1 RadioButtonList1 BulletedList1 绑定数据源方法(方法都一样) ListItem表示其中一项的实例 AppendDataBoundItems 如果不想在绑定后,复盖以前的项,就要开启该项 第一种: 数据源是数组或字符串 ListItem[] d1 = new ListItem[] { new Li... 阅读全文
posted @ 2009-04-18 10:22 xymir 阅读(193) 评论(0) 推荐(0)

摘要: 1. 操作磁盘 (DriveInfo) dr.Name, dr.DriveType, dr.DriveFormat, dr.TotalSize, dr.TotalFreeSpace(输入的时候都有提示,勿死记) static void getdrive() { DriveInfo[] drs = DriveInfo.GetDrives(); ... 阅读全文
posted @ 2009-04-18 10:21 xymir 阅读(159) 评论(0) 推荐(0)

摘要: int? x 我没有搞清在哪里有多大的用处 只觉得和int x一样 using System.Collections.Generic; List k = new List(); 这种泛型灵活性非常大,具备了,数组和 ArrayList两者之长k.Add(new ListItem(3, "三")); public struct m { public int x; ... 阅读全文
posted @ 2009-04-18 10:20 xymir 阅读(314) 评论(1) 推荐(0)

摘要: 1.集合 (比数组灵性更大) ArrayList my = new ArrayList();my.Add("对像");my.Add(1);my.AddRange("一个组或是集合"); my[0] 2.比较 阅读全文
posted @ 2009-04-18 10:18 xymir 阅读(156) 评论(0) 推荐(0)

摘要: 1.接口 不能定义字段,接口都是公共的(这里说定义接口时) 2.继承 3.多态性 4.对象之间的关系 5.运算符重载 6.事件 7.引用类型和值类型 类的修饰符 public 任何地方 无或internal 项目中 abstract 当前项目中,不能实例化,只能继承 sealed 当前项目中,只能实例化; private 只能在类中 protected 类或派生中 类的方法,字段,属性 在定... 阅读全文
posted @ 2009-04-18 10:16 xymir 阅读(120) 评论(0) 推荐(0)

摘要: 1. 输出参数 string x my(string x,out int y) { ........ } my("k"out y); 这样调用后就可以直截得到y的值(y值是在my涵数里计算得到的) 2.结构涵数(就是一个结构类型,里面的数据类型有涵数) struct my { public string x,y; public string Name() { return x+" "+y; } }... 阅读全文
posted @ 2009-04-18 10:15 xymir 阅读(105) 评论(0) 推荐(0)

摘要: 1.枚举 enum 枚举名{value1,value2,......valueN}默认的情况下值从0开始,也可以指定值(一般指定数字)enum my:byte{value1=1,value2=2} 这时可以把my 看作类型一样使用my x = my.value1;Response.Write(x+"\a"); value1Response.Write((int)x); 1 2. 结构 struct... 阅读全文
posted @ 2009-04-18 10:14 xymir 阅读(155) 评论(0) 推荐(0)

摘要: string my = "a string";char[] my1 = my.ToCharArray(); 字符串可以就当作字符数组来处理 在左边,右边增加字符或是指定字符使 字符串达到一定长度, 用于对齐字符串 padleft(10),padleft(10,'-'); k=s.split(x) 把s转换成string数组 x为标示符 s = s.Replace(';', ' '); 阅读全文
posted @ 2009-04-18 10:14 xymir 阅读(119) 评论(0) 推荐(0)