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();
        }
    }
}

结果:

C# ExpandoObject用法

 

相关文章:

  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-07-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2021-11-16
  • 2022-01-23
  • 2021-08-26
相关资源
相似解决方案