public static int FirstCatalogId
        {
            set
            {
                System.Web.HttpContext.Current.Session["_firstCatalogId"] = value;
            }
            get
            {
                if (System.Web.HttpContext.Current.Session["_firstCatalogId"] == null)
                {
                    return 0;
                }
                else
                {
                    return (int)System.Web.HttpContext.Current.Session["_firstCatalogId"];
                }
            }
value 是啥??没定义啊~~~谢谢~~

解决方案 »

  1.   

    这段代码是一个类的属性Value是一个int值
      

  2.   

    不需要定义的,这是属性的标准写法使用的时候设置:
    类名.FirstCatalogId=100;获得:
    int a=类名.FirstCatalogId;
      

  3.   

    属性的写法:
    public int aa
    {
    get { return m_aa; }
    set { aa= value ; }
    }
    如:Class c_BB = new c_BB;
    c_BB.aa = 45;(这个45就是你所说的保留字value--接受的外界赋值),属性的一个用途就是为了隐藏私有成员(比如此处的m_aa)用的。