using System.Reflection; static void EnvironmentDemo() { var pis = typeof(Environment).GetProperties().OrderBy(x=>x.Name).ToList(); for(int i=0;i<pis.Count;i++) { Console.WriteLine($"{pis[i].Name}:{pis[i].GetValue(null, null)}"); } }
Get static class properties and values via reflection
猜你喜欢
转载自www.cnblogs.com/Fred1987/p/12600196.html
今日推荐
周排行