SecureString.AppendChar Method (Char)

 

Appends a character to the end of the current secure string.

Namespace:   System.Security
Assembly:  mscorlib (in mscorlib.dll)

[<HandleProcessCorruptedStateExceptionsAttribute>]
member AppendChar : 
        c:char -> unit

Parameters

c
Type: System.Char

A character to append to this secure string.

Exception Condition
ObjectDisposedException

This secure string has already been disposed.

InvalidOperationException

This secure string is read-only.

ArgumentOutOfRangeException

Performing this operation would make the length of this secure string greater than 65,536 characters.

CryptographicException

An error occurred while protecting or unprotecting the value of this secure string.

If the implementation uses a protection mechanism, such as encryption, the value of this secure string, if any, is unprotected; c is appended; then the new value of the secure string is re-protected.

The following example demonstrates how the AppendChar, InsertAt, RemoveAt, SetAt, and Clear methods affect the value of a SecureString object.

No code example is currently available or this language may not be supported.

The following example demonstrates how the AppendChar and RemoveAt methods can be used to collect the characters in a password.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: