RuntimeInformation.RuntimeIdentifier 属性

定义

获取 (生成运行时的平台,或) 运行应用的平台。

public:
 static property System::String ^ RuntimeIdentifier { System::String ^ get(); };
public static string RuntimeIdentifier { get; }
static member RuntimeIdentifier : string
Public Shared ReadOnly Property RuntimeIdentifier As String

属性值

一个不透明的字符串,用于标识 (生成运行时的平台,或) 运行应用的平台。

注解

.NET 8 及更高版本:此属性返回一个字符串,用于标识为其生成运行时的操作系统和处理器体系结构。 例如,Windows 11 win-x64上的值为 ,Ubuntu 20.04 上的值为 linux-x64

.NET 7 及更早版本:此属性返回一个字符串,用于标识运行当前进程的平台 (操作系统、版本和处理器体系结构) 。 例如,在 Windows 11 上运行应用程序时,值为 win10-x64;在 Ubuntu 20.04 上,该值可以是 ubuntu.20.04-x64

由于此字符串是不透明的,因此不建议将字符串分析为其构成部分。

有关详细信息,请参阅 .NET RID 目录

适用于