<body bgcolor="skyblue">
<form id="form1" runat="server">
<%
int loopl;
NameValueCollection coll = Request.Form;
string[] arr1 = coll.AllKeys;
string[] arr2 = coll.GetValues(arr1[0]);
Response.Write("用户名为:" + arr2[0] + "<br>");
for (int i = 1; i < 11; i++)
{
arr2 = coll.GetValues(arr1[i]);
Response.Write(i + arr2[0] + "<br>");
}
%>
</form>
</body>
运行时显示
string[] arr2 = coll.GetValues(arr1[0]);
索引超出了数组界限
<form id="form1" runat="server">
<%
int loopl;
NameValueCollection coll = Request.Form;
string[] arr1 = coll.AllKeys;
string[] arr2 = coll.GetValues(arr1[0]);
Response.Write("用户名为:" + arr2[0] + "<br>");
for (int i = 1; i < 11; i++)
{
arr2 = coll.GetValues(arr1[i]);
Response.Write(i + arr2[0] + "<br>");
}
%>
</form>
</body>
运行时显示
string[] arr2 = coll.GetValues(arr1[0]);
索引超出了数组界限
解决方案 »
- 请问,这个List查询为什么报错?
- 如何通过串口名获取该串口对应的设备信息
- 跪求随机数的产生与绑定
- .net 有没有提供 打开并显示,多页的tif文件 的控件(在vb中是使用 kedak的imgedit .net 中是使用什么控件)
- 进程间的消息,sendmessage
- Winform:DataGrid的简单问题
- 报表是什么东西?怎么加入到我的程序中?
- c# 怎么获取datagridview中DataGridViewComboBox的显示值(不是value实际值)啊?急
- 请问高手一个问题
- 请问如何获得Web页面上的控件?
- 转义序列中\r和\n的区别是什么?
- 求教个问题:vs 2005 中datagridview 编辑列 的对话框太小!
NameValueCollection coll = Request.Form;
string[] arr1 = coll.AllKeys;
ArrayList list = new ArrayList();
//循环将参数值放入ArrayList
for (int i = 0; i < arr1.Length; i++)
{
String[] values = coll.GetValues(arr1[i]);
for (int j = 0; j < values.Length; j++)
{
list.Add(values[j]);
}
}