C# ExpandoObject用法

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;//添加引用

namespace ExpandoObject_exercise
{
    class Program
    {
        static void Main(string[] args)
        {
            dynamic expand = new ExpandoObject();
            expand.name = "dynamic动态";
            expand.yes = "成功";
            Console.WriteLine("{0}\n{1}", expand.name, expand.yes);
            Console.Read();
        }
    }
}

结果:

 

posted @ 2017-07-31 13:08  LBO.net  阅读(1729)  评论(0编辑  收藏  举报
//返回顶部