zoukankan      html  css  js  c++  java
  • 本来是想用集合的方式来读取request.form 信息的,但是不知道为什么,啥都不显示,麻烦给点高见蛮!!

    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>

    <script language="vb" runat="server">
    sub getformnamevalue(byval nvcoll as namevaluecollection)
    dim i,j as integer
    dim nvarr(),val() as string
    nvarr=nvcoll.allkeys '获取表单所有变量名
    for i=0 to nvarr.getupperbound(0) 
     response.Write("表单变量名为:" & nvarr(i)) ‘'输出第i个变量名
     val = nvcoll.getvalues(nvarr(i)) '输出第i个变量值集
     for j = 0 to val.getupperbound(0)
      response.Write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;值为:" & val(j))
     next j
    response.Write("<br>")
    next i
    end sub
    sub page_load(sender as object,e as eventargs)
     dim formnvcoll as namevaluecollection
     if request.httpmethod = "post" then
      response.Write("执行post处理!<br>")
      formnvcoll = request.Form
     else
      if request.httpmethod = "get" then
       response.Write("执行GET处理!<br>")
       formnvcoll = request.QueryString
      end if
     end if
    end sub
    </script>
    </head>
    <body>
      <form action="index1.aspx" method="post">
         <p>您的姓名:<input type=text name="Name"><br>
         <p>您的年龄:<input type=text name="Age"><br>
         <p>您的性别:<input type=radio name="Sex" value="男" checked>男
                      <input type=radio name="Sex" value="女">女<br>
         <p>您的爱好:<input type=checkbox name="travel" value="yes">旅游
                      <input type=checkbox name="reading" value="yes">读书
                      <input type=checkbox name="music" value="yes">听音乐<br><br>
         <input type="submit" value="提交" name="OK">
         <input type="reset" value="重输" name="re-input">
      </form>
    </body>
    </html>

  • 相关阅读:
    02.创建型————工厂方法模式
    01.创建型————简单工厂模式
    HBase JavaAPI操作示例
    MongoDB
    大数据第三天
    Zookeeper操作
    MR操作
    HDFS操作
    【GISER&&Painter】svg的那些事
    读法克鸡丝博文《技术,产品,团队》有感
  • 原文地址:https://www.cnblogs.com/thcjp/p/339924.html
Copyright © 2011-2022 走看看