ResourceExpressionFields.ClassKey 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得剖析的資源運算式之類別識別碼。
public:
property System::String ^ ClassKey { System::String ^ get(); };
C#
public string ClassKey { get; }
member this.ClassKey : string
Public ReadOnly Property ClassKey As String
String,包含類別識別碼,如果尚未設定類別識別碼則為 Empty。
這個方法會傳回已剖析資源運算式的類別索引鍵。 類別索引鍵代表資源檔的名稱,而且是在格式 <%$ Resources: [Namespace.]ClassKey, ResourceKey $>
的運算式中,在逗號 (,) 之前指定的值。 資源類別的命名空間值是選擇性的。 提供命名空間時,命名空間和類別索引鍵會在 屬性中 ClassKey 傳回。 類別索引鍵不能包含 DBCS) (空格或雙位元組字元集。
若要參考名為 Financial.resx 的資源檔或當地語系化版本,例如 Financial.en-GB.resx,您會包含資源運算式 <%$ Resources: Financial, ResourceKey %>
。 剖析之後, ClassKey 屬性會傳回 「Financial」 做為其值。
注意
敏感性資訊不應該儲存在資源檔中。
產品 | 版本 |
---|---|
.NET Framework | 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 |