SecureString.RemoveAt Method (Int32)

 

Removes the character at the specified index position from this secure string.

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

[<HandleProcessCorruptedStateExceptionsAttribute>]
member RemoveAt : 
        index:int -> unit

Parameters

index
Type: System.Int32

The index position of a character in this secure string.

Exception Condition
ObjectDisposedException

This secure string has already been disposed.

InvalidOperationException

This secure string is read-only.

ArgumentOutOfRangeException

index is less than zero, or greater than or equal to the length of this secure string.

CryptographicException

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

The index is zero-based; the first character in this instance is at index position zero.

If the implementation uses a protection mechanism, such as encryption, the value of this secure string, if any, is unprotected; the character at the specified index position is removed; then the new value 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: