示例代码如下:
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { // Windows 相关逻辑 } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { // Linux 相关逻辑 }