class ClassA
{     
        public static bool Update(Object o)
        {
            //怎么通过Object参数,调用继承自Object的类对象的方法,属性
            return true;
        }
}class ClassB
{
      static void Main(string[] args)
      {
           ClassA.Update(OneObject);
      }
}

解决方案 »

  1.   

    既然是继承自Object的方法,直接使用o.ToString()就可以了。如果不是Object中的方法需要强制转换
    ((ClassA)o).Methed();
      

  2.   

     class ClassA
        {
            public int a = 0;
            private string s = "ss";
            public string SS
            {
                get { return s; }
                set { s = value; }        }
            public void ttt()
            {
                MessageBox.Show("rrrrr");        }        public static bool Update(Object o)
            {
                PropertyInfo p = o.GetType().GetProperty("SS");
                {
                    string s = (string)p.GetValue(o, null); //获取属性
                    s = s + "00000";
                    p.SetValue(o, s, null);   //设置属性
                }            FieldInfo f = o.GetType().GetField("a");
                {
                    int y = (int)f.GetValue(o);
                    y = y + 100;
                    f.SetValue(o, y);
                }
                MethodInfo m = o.GetType().GetMethod("ttt");  //获取方法
                m.Invoke(o, null);  //调用方法
                return true;
            }
               }
      

  3.   

    GetValue能获取到属性的值吗,我要怎么做呢?
      

  4.   

    我知道了“GetValue能获取到属性的值”