StrongNameIdentityPermission.ToXml メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As StrongNameIdentityPermission Dim returnValue As SecurityElement returnValue = instance.ToXml
状態情報を含む、アクセス許可の XML エンコーディング。


' ToXml creates an XML encoding of the permission and its current state; 'FromXml reconstructs a permission with the specified state from the XML encoding. Private Function ToFromXmlDemo() As Boolean Dim returnValue As Boolean = True Dim snIdPerm1, snIdPerm2 As StrongNameIdentityPermission snIdPerm1 = New StrongNameIdentityPermission(blob, "MyCompany.MyDepartment.*", New Version("1.0.0.0")) snIdPerm2 = New StrongNameIdentityPermission(PermissionState.None) snIdPerm2.FromXml(snIdPerm1.ToXml()) Console.WriteLine("Result of ToFromXml = " + snIdPerm2.ToString() + vbLf) Return returnValue End Function 'ToFromXmlDemo
// ToXml creates an XML encoding of the permission and its current state; //FromXml reconstructs a permission with the specified state from the XML encoding. private bool ToFromXmlDemo() { bool returnValue = true; StrongNameIdentityPermission snIdPerm1, snIdPerm2; snIdPerm1 = new StrongNameIdentityPermission(blob, "MyCompany.MyDepartment.*", new Version("1.0.0.0")); snIdPerm2 = new StrongNameIdentityPermission(PermissionState.None); snIdPerm2.FromXml(snIdPerm1.ToXml()); Console.WriteLine("Result of ToFromXml = " + snIdPerm2.ToString() + "\n"); return returnValue; }
// ToXml creates an XML encoding of the permission and its current state; //FromXml reconstructs a permission with the specified state from the XML encoding. bool ToFromXmlDemo() { bool returnValue = true; StrongNameIdentityPermission^ snIdPerm1; StrongNameIdentityPermission^ snIdPerm2; snIdPerm1 = gcnew StrongNameIdentityPermission(blob, "MyCompany.MyDepartment.*", gcnew Version("1.0.0.0")); snIdPerm2 = gcnew StrongNameIdentityPermission(PermissionState::None); snIdPerm2->FromXml(snIdPerm1->ToXml()); Console::WriteLine("Result of ToFromXml = " + snIdPerm2->ToString() + "\n"); return returnValue; } public:

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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- StrongNameIdentityPermission.ToXml メソッドのページへのリンク