Cache("Cache1")="Value1"
Cache.Insert("Cache2","Value2")
Dim obj As Object
For Each obj In Cache
   Response.Write("Cache 名称:" & obj.Key & "<br>" & _"Cache 内容:" & Cache(obj.Key).ToString &"<br>")
Next

解决方案 »

  1.   

    foreach   (DictionaryEntry   de   in   Cache)   
    {
        
    }
    或者
    IDictionaryEnumerator CacheEnum = _cache.GetEnumerator();
    while (CacheEnum.MoveNext())
    {
        
    }
      

  2.   


    foreach (Object obj in Cache)
    {
               Response.Write("Cache 名称:" & obj.Key & "<br>" & _"Cache 内容:" & Cache(obj.Key).ToString &"<br>")        }
      

  3.   


                Cache["Cache1"] = "Value1";
                Cache.Insert("Cache2", "Value2");
                IDictionaryEnumerator ide = Cache.GetEnumerator();
                while (ide.MoveNext())
                {
                    Response.Write("Cache 名称:" + ide.Key + "<br>" + "Cache 内容:" + ide.Value +"<br>");
                }
      

  4.   

    献丑了……抛砖引玉: Cache["Cache1"] = "Value1";
    Cache.Insert("Cache2","Value2");
    foreach(DictionaryEntry obj in Cache)
    {
    Response.Write("Cache 名称:" + obj.Key + "<br>" + "Cache 内容:" + obj.Value.ToString() + "<br>" );
    }
      

  5.   


    foreach(DictionaryEntry obj in Cache)
        {
            Response.Write("Cache 名称:" + obj.Key + "<br>" + "Cache 内容:" + obj.Value.ToString() + "<br>" );
        }
      

  6.   


       Cache("Cache1")="Value1"
       Cache.Insert("Cache2","Value2")   for(Object obj in Cache)
       {
         Response.Write("Cache 名称:" & obj.Key & "<br>" & _"Cache 内容:" & Cache(obj.Key).ToString &"<br>")
       }