| //以下代码根据Ascll值输出字母A--Z
ListItem en =new ListItem(); for(int c=(int)'A';c<=(int)'Z';c++) { en.Text=(Char)c; this.DropDownList1.Item.Add(en); }
for(int c=(int)'A';c<=(int)'Z';c++) { ListItem item=new ListItem(((char)c).ToString()); this.DropDownList1.Items.Add(item); }
stirng[] chars=new string[26]; for(int c=(int)'A';c<=(int)'Z';c++) { chars[c-((int)'A')]=(char)c; c++; }
this.DropDownList1.DataSource=chars; this.DataBind();
for(int c=(int)'A';c<=(int)'Z';c++) { Response.Write((char)c); c++; }
|