当前位置: 移动技术网 > IT编程>开发语言>c# > C# show Environment property info name and value retrieve, Maximize the Console Window based on window resolution

C# show Environment property info name and value retrieve, Maximize the Console Window based on window resolution

2019年11月28日  | 移动技术网IT编程  | 我要评论
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);
        }

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网