<%@ Page Language="C#" Debug="true"%>
<%
int loop1;
//Load NameValueCollection object.
NameValueCollection coll = Request.Form;
//Get name of all keys into a string array.
String[] arr1 = coll.AllKeys;
%>
<html>
<p ALIGN="CENTER"><font SIZE="+2" COLOR="#000080"><b>你提交的调查表内容如下:</b></font></p>
<head><title>用户信息</title></head>
<body bgcolor="#6699dd"
<%
String[] arr2 = coll.GetValues(arr1[0]);
Response.Write("用户名为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[1]);
Response.Write("第一次输入的密码为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[2]);
Response.Write("第二次输入的密码为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[3]);
Response.Write("你的真实姓名为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[4]);
Response.Write("你的住址为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[5]);
Response.Write("你的院系为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[6]);
Response.Write("你的留言为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[7]);
Response.Write("你所在的城市为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[8]);
Response.Write("你的爱好为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[9]);
Response.Write("你的性别为:" + arr2[0] + "<br>");
arr2 = coll.GetValues(arr1[10]);
Response.Write("你的血型为:" + arr2[0] + "<br>");
%>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body bgcolor="#6699dd">
<h2 align="center">调查表单</h2>
<hr />
<form id="form1" runat="server">
<div>
<p>用户名:<input type="text" size="20" name="UserName" /></p>
<p>输入密码:<input type="password" size="20" name="password1" /></p>
<p>密码校对:<input type="password" size="20" name="password2" /></p>
<p>真实姓名:<input type="text" size="20" name="truename" /></p>
<p>电子邮箱:<input type="text" size="20" name="email" /></p>
<p>住址:<input type="text" size="40" name="address" /></p>
<p>院系:<input type="text" size="20" name="yuanxi" /></p>
<p>留言:</p>
<p><textarea name="Memo" rows="4" cols="60"></textarea></p>
<p>所在城市:<select name="City" size="1">
<option>北京市</option>
<option>上海市</option>
<option>天津市</option>
<option>重庆市</option>
</select></p>
<ul>
个人爱好:<li><input type="checkbox" name="love" value="跳舞" />跳舞<br />
<input type="checkbox" name="love" value="唱歌" />唱歌<br />
<input type="checkbox" name="love" value="ON" />喝酒<br />
<input type="checkbox" name="love" value="打牌" />打牌<br />
<input type="checkbox" name="love" value="看书" />看书<br />
</li>
</ul>
<p>性别:<input Type="Radio" Name="sex" Value="男" Checked />男<input Type="Radio" Name="sex" Value="女">女</p>
<p>血型:<input Type="Radio" Name="blood" Value="A" Checked />A<input Type="Radio" Name="blood" Value="B" />B<input Type="Radio" Name="blood" Value="AB" />AB<input Type="Radio" Name="blood" Value="O" />O</p>
<p><input type="submit" value="提交" /></p>
</div>
</form>
</body>
</html>