This documentation is archived and is not being maintained.

SecureString.IsReadOnly Method

Note: This method is new in the .NET Framework version 2.0.

Indicates whether this secure string is marked read-only.

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

public bool IsReadOnly ()
public boolean IsReadOnly ()
public function IsReadOnly () : boolean

Return Value

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

Exception typeCondition


This secure string has already been disposed.

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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0