there is no problem to declare it.but are you sure import this namespaceusing System.Collections.Specialized;

解决方案 »

  1.   

    using System;
    using System.Collections;
    using System.Collections.Specialized;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace WebApplication15
    {
    /// <summary>
    /// WebForm1 的摘要说明。
    /// </summary>
    public class WebForm1 : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    } #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion
    void AnswerPost()
    {
    if(Request.HttpMethod=="post")
    {
    int loop1,loop2;
    string[] arr;
    string[] val;
    NameValueColleciton coll;
    coll=Request.Form;
    arr=coll.AllKeys;
                                         ……
    }
    }
    }
    }
      

  2.   

    d:\inetpub\wwwroot\webapplication15\webform1.aspx.cs(51,5): error CS0246: 找不到类型或命名空间名称“NameValueColleciton”(是否缺少 using 指令或程序集引用?)
    d:\inetpub\wwwroot\webapplication15\webform1.aspx.cs(52,5): error CS0103: 名称“coll”在类或命名空间“WebApplication15.WebForm1”中不存在
    d:\inetpub\wwwroot\webapplication15\webform1.aspx.cs(53,9): error CS0246: 找不到类型或命名空间名称“coll”(是否缺少 using 指令或程序集引用?)
      

  3.   

    是NameValueCollection不是NameValueColleciton