C# show Environment property info name and value retrieve, Maximize the Console Window based on window resolution
程序员文章站
2022-04-26 21:47:40
using System.Reflection; static void ShowEnvironmentInfoDemo() { Type type = typeof(Environment); PropertyInfo[] pis = type.GetProperties(); if (pis !... ......
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); }
上一篇: WebView内存泄漏解决方案
下一篇: 域名知识之认识世界各地域名后缀