ResourceExpressionFields.ClassKey ResourceExpressionFields.ClassKey ResourceExpressionFields.ClassKey ResourceExpressionFields.ClassKey Property


取得剖析的資源運算式之類別識別碼。Gets the class key for a parsed resource expression.

 property System::String ^ ClassKey { System::String ^ get(); };
public string ClassKey { get; }
member this.ClassKey : string
Public ReadOnly Property ClassKey As String


String,包含類別識別碼,如果尚未設定類別識別碼則為 EmptyA String containing the class key, or Empty if the class key has not been set.


這個方法會傳回剖析的資源運算式的類別索引鍵。This method returns the class key for a parsed resource expression. 類別索引鍵代表資源檔的名稱,而是在表單的運算式中指定逗號 (,) 之前的值<%$ Resources: [Namespace.]ClassKey, ResourceKey $>The class key represents the name of the resource file, and is the value specified before the comma (,) in an expression of the form <%$ Resources: [Namespace.]ClassKey, ResourceKey $>. 資源類別的命名空間值是選擇性的。A namespace value for the resource class is optional. 提供命名空間時,會將命名空間和類別索引鍵傳回在ClassKey屬性。When a namespace is provided, the namespace and the class key are returned in the ClassKey property. 類別索引鍵不能包含空格或雙位元組字元集 (DBCS)。The class key cannot contain spaces or double-byte character sets (DBCS).

若要參考名為 Financial.resx 或當地語系化的版本,例如 Financial.en GB.resx 資源檔,您會在加入資源運算式 <%$ Resources: Financial, ResourceKey %>To reference a resource file named Financial.resx or a localized version such as Financial.en-GB.resx, you would include the resource expression <%$ Resources: Financial, ResourceKey %>. 剖析之後,ClassKey屬性會傳回 「 財務 」 做為其值。After parsing, the ClassKey property would return "Financial" as its value.


機密資訊不應該儲存在資源檔。Sensitive information should not be stored in a resource file.