打印本文 打印本文 关闭窗口 关闭窗口
NET下根据Ascll值输出对应的字符
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1700  更新时间:2009/6/9 2:35:12  文章录入:mintao  责任编辑:mintao

//以下代码根据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++;
}

打印本文 打印本文 关闭窗口 关闭窗口