mscorlib 2.0.0.0 4.0.0.0 System.Object System.IDisposable

An instance of the class is both immutable and, when no longer needed, cannot be programmatically scheduled for garbage collection; that is, the instance is read-only after it is created and it is not possible to predict when the instance will be deleted from computer memory. Consequently, if a object contains sensitive information such as a password, credit card number, or personal data, there is a risk the information could be revealed after it is used because your application cannot delete the data from computer memory.

A object is similar to a object in that it has a text value. However, the value of a object is automatically encrypted, can be modified until your application marks it as read-only, and can be deleted from computer memory by either your application or the .NET Framework garbage collector.

The value of an instance of is automatically encrypted when the instance is initialized or when the value is modified. Your application can render the instance immutable and prevent further modification by invoking the method.

Note that has no members that inspect, compare, or convert the value of a . The absence of such members helps protect the value of the instance from accidental or malicious exposure. Use appropriate members of the class, such as the method, to manipulate the value of a object.

The class and its members are not visible to COM. For more information, see .

Represents text that should be kept confidential. The text is encrypted for privacy when being used, and deleted from computer memory when no longer needed. This class cannot be inherited.

- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

- Constructor
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  This constructor initializes the new object to the number of characters in specified by ; the value of the instance is then encrypted.

  In C#, this constructor is defined only in the context of unsafe code.

  Initializes a new instance of the class from a subarray of objects.

  A pointer to an array of objects.
  The number of elements of to include in the new instance.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions
  System.Void ``

  The value of this secure string, if any, is decrypted; is appended; then the new value of the secure string is encrypted.

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

  A character to append to this secure string.
- Method
  2.0.0.0
  4.0.0.0
  System.Void

  The computer memory that contains the value of this secure string is zeroed, then the length of the value of this secure string is set to zero.

  Deletes the value of the current secure string.

- Method
  2.0.0.0
  4.0.0.0
  System.Security.SecureString

  If an instance of a is marked read-only, the copy of that instance will not be read-only.

  Creates a copy of the current secure string.

  A duplicate of this secure string.

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  The method writes binary zeroes to the allocated memory that contains the value of this object, then frees the allocated memory.

  For more information, see Finalize Methods and Destructors and Garbage Collection.

  Releases all resources used by the current object.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions
  System.Void `` ``

  The index is zero-based and the first character in this secure string is at index position zero.

  The value of the secure string, if any, is decrypted; is inserted at the specified location; then the new value is encrypted. The method yields the same results as the method, which inserts a character at the end of a secure string, if the parameter of is set to the length of this instance.

  Inserts a character in this secure string at the specified index position.

  The index position where parameter is inserted. The character to insert.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean

  After an instance of is marked read-only by the method, any attempt to modify the value of the instance throws an . Use the method to test whether a is read-only.

  Indicates whether this secure string is marked read-only.

  true if this secure string is marked read-only; otherwise, false.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property returns the number of objects in this instance, not the number of Unicode characters. The reason is that a Unicode character might be represented by more than one object.

  Gets the number of characters in the current secure string.

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  Initialize the text value of an instance of the class with the constructors, and modify the value with the , , , , and methods.

  After you have made your final modifications, use the method to make the value of the instance immutable (read-only). After the value is marked as read-only, any further attempt to modify it throws an .

  The effect of invoking is permanent because no means is provided to make the secure string modifiable again. Use the method to test whether an instance of is read-only.

  Makes the text value of this secure string read-only.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions
  System.Void ``

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

  The value of this secure string, if any, is decrypted; the character at the specified index position is removed; then the new value is encrypted.

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

  The index position of a character in this secure string.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions
  System.Void `` ``

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

  The value of the secure string, if any, is decrypted; is assigned to the specified index position; then the new value is encrypted.

  Replaces the existing character at the specified index position with another character.

  The index position of an existing character in this secure string A character that replaces the existing character.