Label Property
Label
A short name or description of the Credential.
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when the supplied string is null. |
System.ArgumentOutOfRangeException | Thrown when the string's UTF-8 byte count does not meet the length parameters MinLabelByteCount and MaxLabelByteCount. |
System.ArgumentException | Thrown when there is a character that cannot be encoded with UTF-8. The exact exception may be derived from ArgumentException. |
Remarks
The string only contains characters that can be encoded with UTF-8, and its UTF-8 byte count is between MinLabelByteCount and MaxLabelByteCount. Non-printing characters are allowed, as long as they can be encoded with UTF-8. For example, null (UTF-8: 0x00) and Right-To-Left Mark U+200F (UTF-8: 0xE2 0x80 0x8F) would be acceptable.
The System.Text.UTF8Encoding class contains methods such as System.Text.UTF8Encoding.GetByteCount(System.String) which can be used to validate the string prior to attempting to set it here. It is recommended to use the constructor System.Text.UTF8Encoding.#ctor(System.Boolean,System.Boolean) so error detection is enabled for invalid characters.