zoukankan      html  css  js  c++  java
  • C# show Environment property info name and value retrieve, Maximize the Console Window based on window resolution

    using System.Reflection;
    
    static void ShowEnvironmentInfoDemo()
            {
                Type type = typeof(Environment);
                PropertyInfo[] pis = type.GetProperties();
                if (pis != null && pis.Any())
                {
                    Parallel.ForEach(pis, x =>
                    {
                        Console.WriteLine($"Name:{x.Name},value:{x.GetValue(x)}");
                    });
                }
            }
      static void ConsoleWindowDemo()
            {
                try
                {
                    Type type = typeof(Console);
                    PropertyInfo[] pis = type.GetProperties();
                    if (pis != null && pis.Any())
                    {
                        Parallel.ForEach(pis, x =>
                        {
                            Console.WriteLine($"Name:{x.Name},Value:{x.GetValue(x)}");
                        });
                    }
                }
                catch
                {
    
                }            
            }
    static void MaximizeConsoleWindow()
            {
                Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight);
            }
  • 相关阅读:
    集合
    第五天
    第四天
    第二天
    ieee 期刊缩写(转载)
    JAVA学习笔记03
    JAVA学习笔记2
    JAVA学习笔记01
    Latex 图片排版
    非奇异终端滑模
  • 原文地址:https://www.cnblogs.com/Fred1987/p/11946100.html
Copyright © 2011-2022 走看看