Hashtable ht = new Hashtable();
已经new出来来了 为什么不ht.add这个add就是点不出来
该倒的包我都倒了

解决方案 »

  1.   

    你确定导入了...using System.Collections;
      

  2.   

     确定 都能new出来Hashtable 
      

  3.   

    using System;
    using System.CollectionsHashtable h= new Hashtable (); 
    h.Add("A","AA");没问题
      

  4.   

    导入命名空间  using System.Collections;如果你把Hashtable  new在类里面  就点不出来他的Add方法 
     要new在某个事件中就可以点出他的Add方法
      
      

  5.   

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;public partial class Hashtable : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Hashtable ht = new Hashtable();
                ht.add这就出不来了 没什么错吧
      

  6.   

    从你的命名来看Hashtable是网页的名字,你要用的是HashTable,注意大小写。
      

  7.   

    public class SamplesHashtable
    {
        public static void Main()
        {
            // Creates and initializes a new Hashtable.
            Hashtable myHT = new Hashtable();
            myHT.Add("one", "The");
            myHT.Add("two", "quick");
            myHT.Add("three", "brown");
            myHT.Add("four", "fox");        // Displays the Hashtable.
            Console.WriteLine("The Hashtable contains the following:");
            PrintKeysAndValues(myHT);
        }
        public static void PrintKeysAndValues(Hashtable myHT)
        {
            Console.WriteLine("\t-KEY-\t-VALUE-");
            foreach (DictionaryEntry de in myHT)
                Console.WriteLine("\t{0}:\t{1}", de.Key, de.Value);
            Console.WriteLine();
        }
    }
      

  8.   

    加上你的命名空间+hashtable 就能点出来了!!你的hashtable 不是那个命名空间下的
      

  9.   

    你确定命名空间一样的么,用USING导了没啊???