我在学asp.net,有个难点我无法突破..请帮帮我!

来源:百度知道 编辑:UC知道 时间:2024/06/17 07:13:09
在ASP.NET中有很多对象类型和字符串或者转换类的语句我不懂的判断..

比如提取的数据应该如何转换..

我现在接触的有.ToString();ToInt32;(Int)

我想知道如何能快速掌握这些..什么时候需要用哪个,,语法..

有没有什么掌握技巧...

现在学习中最大的难题就是遇到这些东西..

还有一个如下

protected void Button1_Click(object sender, EventArgs e)
{
string[] a = new string[3];
a[0] = "小明";
a[1] = "小刚";
a[2] = "小强";
Application.Add("a",a);
}
protected void Button2_Click(object sender, EventArgs e)
{
string[] b =(string[])Application["a"];
for (int i = 0; i < b.Length; i++)
{
this.ListBox1.Items.Add(b[i]);
}

i<b.Length这个语句是怎么定义判断的..

是不是把数组中的所有项目加起来判断?

this.ListBox1.Items.Add(b[i]);

b[i]我不能理解...请详细解释下含义..
我现在接触的有.ToString();ToInt32;(Int);string[];

每个的意义

a的长度是3啊,前面不定义过了吗!string[] a = new string[3];
b.Length 是a赋值给他的。
然后for (int i = 0; i < b.Length; i++) ,意思是当i小于3时,增加数据.
也就是说下拉菜单将"小明""小刚";"小强";增加了进去

b[i] 就是说那个数组啊,在这个前面有
for (int i = 0; i < b.Length; i++)

这个就是用来循环,把数组中的每个都加到ListBox中