netcore之判断系统

netcore判断系统是哪种系统:

            Console.WriteLine("判断是否为Windows Linux OSX");
            Console.WriteLine($"Linux:{RuntimeInformation.IsOSPlatform(OSPlatform.Linux)}");
            Console.WriteLine($"OSX:{RuntimeInformation.IsOSPlatform(OSPlatform.OSX)}");
            Console.WriteLine($"Windows:{RuntimeInformation.IsOSPlatform(OSPlatform.Windows)}");

猜你喜欢

转载自blog.csdn.net/g0415shenw/article/details/84766786
今日推荐