ResourceExpressionFields.ClassKey 属性

定义

获取经过分析的资源表达式的类键。Gets the class key for a parsed resource expression.

public:
 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).

若要引用名为 "财经" 的资源文件或本地化版本 (例如, 财经. .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.

适用于

另请参阅