Web项目的Application对象是否也是引用类型呢?

由于项目需要在Application对象中存有ArrayList对象。
ArrayList a=new ArrayList();
a.Add("1");
a.Add("2");
Application["test"]=a;

------------------
在另一页里调用
ArrayList b=(ArrayList)Application["test"];
b.Add("3");
b.Add("4");

---------------
最后输出Application吧

Response.Write(((ArrayList)Application["test"]).Count.ToString());

结果等于4。
本来在想按对象是传引用的原则应该是这样的,但做过几年的asp,这样来看还真不太敢相信:)

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-09-28
  • 2022-12-23
  • 2022-01-30
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
相关资源
相似解决方案