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