Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SecureString.AppendChar Method

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.

ExceptionCondition
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft