Returns a string representation of the state of the current instance.
A string containing the XML representation of the state of the current instance.
Note:This method overrides object.ToString.
The following example displays the XML that encodes the state of a System.Security.PermissionSet .
C# Example
using System; using System.Security; using System.Security.Permissions; public class PermissionSetToStringExample { public static void Main() { PermissionSet ps = new PermissionSet(PermissionState.Unrestricted); Console.WriteLine(ps.ToString()); } }The output is
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>
Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0