欢迎加我的QQ群:193522571,一起来讨论、交流!

saddle中每一个属性赋值给到WebPlate中的同名属性

   //将saddle中每一个属性赋值给到WebPlate中的同名属性
   foreach (PropertyInfo info in saddle.GetType().GetProperties())
   {
    try
    {
     string objString = info.Name;
     object objValue = saddle.GetType().GetProperty(objString).GetValue(saddle, null);
     this.GetType().GetProperty(objString).SetValue(this, objValue, null);
    }
    catch
    {
    }
   }

posted @ 2017-09-22 16:21  swtool  阅读(131)  评论(0编辑  收藏  举报
欢迎加我的QQ群:193522571,一起来讨论、交流!