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 上執行應用程式時,值為 ,而 Ubuntu 20.04 上的 值 win10-x64 可以是 ubuntu.20.04-x64

由於此字串不透明,因此不建議將字串剖析為其組成部分。

如需詳細資訊,請參閱 .NET RID 目錄

適用於