StronglyTypedResourceBuilder.VerifyResourceName Method
Assembly: System.Design (in system.design.dll)
public static function VerifyResourceName ( key : String, provider : CodeDomProvider ) : String
Parameters
- key
The string to verify and, if necessary, convert to a valid resource name.
- provider
A CodeDomProvider object that specifies the target language to use.
Return Value
A valid resource name with any invalid tokens replaced with the underscore (_) character, or a null reference (Nothing in Visual Basic) if the string still contains invalid characters according to the language specified by the generator parameter.The VerifyResourceName method takes a string, compares each character with a set of invalid tokens based on the language specified by the generator parameter, and replaces any invalid characters with an underscore character (which is valid in resource name strings). The characters that will be replaced with an underscore are as follows:
' ' (space), U+00A0 (non-breaking space), '.' (period), ',' (comma), ';' (semicolon), '|', '~', '@', '#', '%', '^', '&', '*', '+', '-', '/', '\\', '<', '>', '?', '[', ']', '(', ')', '{', '}', '"' (quote), ''' (apostrophe), ':', and '!'.
Note |
|---|
| Strongly-typed resources do not allow language keywords (such as if, for, and so on) as resource key names. However, the System.CodeDom design pattern allows the use of language keywords by prefixing the keyword with the underscore character. The VerifyResourceName method calls the CreateValidIdentifier method to enforce this design. Therefore, if you use a resource name that is the same as a language keyword, such as for, the name appears as _for in the generated strongly-typed resource class. |
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Note