在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.实现代码
using System; namespace NameofUsage { /// <summary> /// C# nameof用法 /// </summary> internal class Program { private static void Main() { Console.Title = "C# nameof用法"; Person p = new Person(); Console.WriteLine(nameof(p)); Console.WriteLine(nameof(p.Name)); Console.WriteLine(nameof(Person.CreateDateTime)); Console.ReadKey(); } } public class Person { public long Id { get; set; } public string Name { get; set; } public DateTime CreateDateTime { get; set; } } } 2.运行效果
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论