CultureInfo.UseUserOverride 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得值,指出目前 CultureInfo 是否使用使用者選取的文化特性設定。
public:
property bool UseUserOverride { bool get(); };
C#
public bool UseUserOverride { get; }
member this.UseUserOverride : bool
Public ReadOnly Property UseUserOverride As Boolean
如果目前 CultureInfo 使用使用者選取的文化特性設定,則為 true
;否則為 false
。
使用者可能會透過 控制台 的區域和語言選項部分,選擇覆寫與目前 Windows 文化特性相關聯的某些值。 例如,使用者可能會選擇以不同的格式顯示日期,或使用文化特性預設值以外的貨幣。
如果 是 UseUserOverridetrue
且指定的文化特性符合 Windows 的目前文化特性,則會CultureInfo使用這些覆寫,包括屬性所DateTimeFormat傳回之實例屬性DateTimeFormatInfo的用戶設定,以及 屬性所NumberFormat傳回之實例的屬性NumberFormatInfo。 如果使用者設定與相關聯的 CultureInfo文化特性不相容,例如,如果選取的行事曆不是 其中 OptionalCalendars一個 ,則方法的結果和屬性的值是未定義的。
建立 時 CultureInfo 會設定這個屬性。
產品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |