Export (0) Print
Expand All

ZoneIdentityPermission Class

Defines the identity permission for the zone from which the code originates. This class cannot be inherited.

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

[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public sealed class ZoneIdentityPermission : CodeAccessPermission
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class ZoneIdentityPermission extends CodeAccessPermission
SerializableAttribute 
ComVisibleAttribute(true) 
public final class ZoneIdentityPermission extends CodeAccessPermission

This permission can determine whether calling code is from a certain zone. Zones are configured according to the Microsoft Internet Explorer options, and are mapped from URL by Internet Explorer's IInternetSecurityManager and related APIs. Only exact zone matches are defined for the permission; a URL can only belong to one zone.

  • Local intranet zone: The Local intranet zone is used for content located on a company's intranet. Because the servers are within a company's firewall, content on the intranet is assigned a higher level of trust.

  • Trusted sites zone: The Trusted sites zone is used for content located on Web sites that are considered more reputable or trustworthy than other sites on the Internet. Users can use this zone to assign a higher level of trust to specific Internet sites. The URLs of these trusted Web sites need to be mapped into this zone by the user. By default, sites in the Trusted sites zone receive no higher trust than those in the Internet zone. A user or company needs to change the level of trust granted to this zone if they want the sites it contains to be given a higher level of trust.

  • Internet zone: The Internet zone is used for the Web sites on the Internet that do not belong to another zone. The default settings allow code downloaded from these sites only minimal access to resources on the user's computer. Web sites that are not mapped into other zones automatically fall into this zone.

  • Restricted sites zone: The Restricted sites zone is used for Web sites that contain content that could cause, or could have previously caused, problems when downloaded. This zone could be used to prevent code downloaded from these sites from running on the user's computer. The URLs of these untrusted Web sites need to be mapped into this zone by the user.

  • Local Machine zone: The Local Machine zone is an implicit zone that is used for content that exists on the user's computer. The content found on the user's computer, except for content cached by Internet Explorer on the local system, is treated with a very high level of trust.

NoteNote

In the .NET Framework versions 1.0 and 1.1, identity permissions cannot have an Unrestricted permission state value. In the .NET Framework version 2.0, identity permissions can have any permission state value. This means that in version 2.0, identity permissions have the same behavior as permissions that implement the IUnrestrictedPermission interface. For information on executing version 2.0 applications with version 1.1 CAS policy, see <legacyV1CASPolicy> Element.

using System;
using System.Security;
using System.Security.Permissions;

public class ZoneIdentityDemo
{
    // IsSubsetOf determines whether the current permission is a subset of the specified permission.
    private bool IsSubsetOfDemo()
    {
        bool returnValue = true;
        SecurityZone zone1, zone2;
        ZoneIdentityPermission zoneIdPerm1, zoneIdPerm2;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();
        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(out zone1))
        {
            zoneIdPerm1 = new ZoneIdentityPermission( zone1);
            zoneGen2.ResetIndex();
            Console.WriteLine("********************************************************\n");

            while (zoneGen2.CreateZone(out zone2))
            {
                zoneIdPerm2 = new ZoneIdentityPermission( zone2);
                try
                {
                    if (zoneIdPerm1.IsSubsetOf(zoneIdPerm2))
                    {
                        Console.WriteLine(zoneIdPerm1.SecurityZone + " is a subset of " +
                            zoneIdPerm2.SecurityZone);
                    }
                    else
                    {
                        Console.WriteLine(zoneIdPerm1.SecurityZone + " is not a subset of " +
                            zoneIdPerm2.SecurityZone);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("An exception was thrown for subset :" + zoneIdPerm1 + "\n" +
                        zoneIdPerm2 + "\n" + e);
                    returnValue = false;
                }
            }
        }
        return returnValue;
    }
    // Union creates a new permission that is the union of the current permission and the specified permission.
    private bool UnionDemo()
    {
        bool returnValue = true;
        SecurityZone zone1, zone2;
        ZoneIdentityPermission zoneIdPerm1, zoneIdPerm2;
        IPermission zoneIdPerm3;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();
        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(out zone1))
        {
            zoneIdPerm1 = new ZoneIdentityPermission( zone1);
            Console.WriteLine("**********************************************************\n");
            zoneGen2.ResetIndex();

            while (zoneGen2.CreateZone(out zone2))
            {
                zoneIdPerm2 = new ZoneIdentityPermission( zone2);
                try
                {
                    zoneIdPerm3 = (ZoneIdentityPermission)zoneIdPerm1.Union(zoneIdPerm2);
                    zoneIdPerm3 = zoneIdPerm1.Union(zoneIdPerm2);

                    if (zoneIdPerm3 == null)
                    {
                        Console.WriteLine("The union of " + zone1 + " and " + zone2 + " is null.");
                    }
                    else
                    {
                        Console.WriteLine("The union of " + zoneIdPerm1.SecurityZone + " and " +
                            zoneIdPerm2.SecurityZone + " = " +
                            ((ZoneIdentityPermission)zoneIdPerm3).SecurityZone.ToString());
                    }
                }
                catch (Exception e)
                {
                    // Expected exception.
                    Console.WriteLine("An exception was thrown for union :" + e.Message);
                }

            }
        }

        return returnValue;

    }
    // Intersect creates and returns a new permission that is the intersection of the current
    // permission and the permission specified.
    private bool IntersectDemo()
    {
        bool returnValue = true;
        SecurityZone zone1, zone2;
        ZoneIdentityPermission zoneIdPerm1, zoneIdPerm2, zoneIdPerm3;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();
        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(out zone1))
        {
            zoneIdPerm1 = new ZoneIdentityPermission( zone1);
            Console.WriteLine("**********************************************************\n");
            zoneGen2.ResetIndex();

            while (zoneGen2.CreateZone(out zone2))
            {
                zoneIdPerm2 = new ZoneIdentityPermission( zone2);

                zoneIdPerm3 = (ZoneIdentityPermission)zoneIdPerm1.Intersect(zoneIdPerm2);
                if (zoneIdPerm3 != null)
                {
                    Console.WriteLine("The intersection of " + zone1 + " and " + zone2 + " = " +
                        ((ZoneIdentityPermission)zoneIdPerm3).SecurityZone.ToString());
                }
                else
                {
                    Console.WriteLine("The intersection of " + zone1 + " and " + zone2 + " is null.");
                }
            }
        }

        return returnValue;
    }
    //Copy creates and returns an identical copy of the current permission.
    private bool CopyDemo()
    {

        bool returnValue = true;

        SecurityZone zone1;
        ZoneIdentityPermission zoneIdPerm1, zoneIdPerm2;

        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();

        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(out zone1))
        {
            zoneIdPerm1 = new ZoneIdentityPermission( zone1);
            zoneGen2.ResetIndex();
            Console.WriteLine("********************************************************\n");
            try
            {
                zoneIdPerm2 = (ZoneIdentityPermission)zoneIdPerm1.Copy();
                Console.WriteLine("Result of copy = " + zoneIdPerm2.ToString());

            }
            catch (Exception e)
            {
                Console.WriteLine("Copy failed :" + zoneIdPerm1.ToString() + e);
                continue;
            }
        }
        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.
    private bool ToFromXmlDemo()
    {

        bool returnValue = true;

        SecurityZone zone1;
        ZoneIdentityPermission zoneIdPerm1, zoneIdPerm2;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();
        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(out zone1))
        {
            zoneIdPerm1 = new ZoneIdentityPermission( zone1);
            Console.WriteLine("********************************************************\n");
            zoneGen2.ResetIndex();
            try
            {
                zoneIdPerm2 = new ZoneIdentityPermission(PermissionState.None);
                zoneIdPerm2.FromXml(zoneIdPerm1.ToXml());
                Console.WriteLine("Result of ToFromXml = " +
                    zoneIdPerm2.ToString());

            }
            catch (Exception e)
            {
                Console.WriteLine("ToFromXml failed :" + zoneIdPerm1.ToString() + e);
                continue;
            }
        }

        return returnValue;

    }
    // Invoke all demos.
    public bool RunDemo()
    {
        bool returnCode = true;
        bool tempReturnCode;

        // Call the IsSubsetOf demo.
        if (tempReturnCode = IsSubsetOfDemo()) Console.Out.WriteLine("IsSubsetOf demo completed successfully.");
        else
            Console.Out.WriteLine("IsSubsetOf demo failed.");
        returnCode = tempReturnCode && returnCode;

        // Call the Union demo.
        if (tempReturnCode = UnionDemo()) Console.Out.WriteLine("Union demo completed successfully.");
        else
            Console.Out.WriteLine("Union demo failed.");
        returnCode = tempReturnCode && returnCode;

        // Call the Intersect demo.
        if (tempReturnCode = IntersectDemo()) Console.Out.WriteLine("Intersect demo completed successfully.");
        else
            Console.Out.WriteLine("Intersect demo failed.");
        returnCode = tempReturnCode && returnCode;


        // Call the Copy demo.
        if (tempReturnCode = CopyDemo()) Console.Out.WriteLine("Copy demo completed successfully.");
        else
            Console.Out.WriteLine("Copy demo failed.");
        returnCode = tempReturnCode && returnCode;

        // Call the ToFromXml demo.
        if (tempReturnCode = ToFromXmlDemo()) Console.Out.WriteLine("ToFromXml demo completed successfully.");
        else
            Console.Out.WriteLine("ToFromXml demo failed.");
        returnCode = tempReturnCode && returnCode;

        return (returnCode);
    }
    // Test harness.
    public static void Main(String[] args)
    {
        try
        {
            ZoneIdentityDemo democase = new ZoneIdentityDemo();
            bool returnCode = democase.RunDemo();
            if (returnCode)
            {
                Console.Out.WriteLine("ZoneIdentityPermission demo completed successfully.");
                Console.Out.WriteLine("Press the Enter key to exit.");
                string consoleInput = Console.ReadLine();
                System.Environment.ExitCode = 100;
            }
            else
            {
                Console.Out.WriteLine("ZoneIdentityPermission demo failed.");
                Console.Out.WriteLine("Press the Enter key to exit.");
                string consoleInput = Console.ReadLine();
                System.Environment.ExitCode = 101;
            }
        }
        catch (Exception e)
        {
            Console.Out.WriteLine("ZoneIdentityPermission demo failed.");
            Console.WriteLine(e.ToString());
            Console.Out.WriteLine("Press the Enter key to exit.");
            string consoleInput = Console.ReadLine();
            System.Environment.ExitCode = 101;
        }
    }
}


// This class generates ZoneIdentityPermission objects.

internal class ZoneGenerator
{


    private SecurityZone[] myZone =
{ SecurityZone.NoZone, SecurityZone.Internet, SecurityZone.Intranet, SecurityZone.MyComputer, SecurityZone.Untrusted, SecurityZone.Trusted };

    private int zoneIndex = 0;

    public ZoneGenerator()
    {
        ResetIndex();
    }

    public void ResetIndex()
    {
        zoneIndex = 0;
    }
    // CreateZone creates ZoneIdentityPermission objects.
    public bool CreateZone(out SecurityZone zone)
    {

        if (zoneIndex >= myZone.Length)
        {

            zone = SecurityZone.NoZone;
            zoneIndex++;
            return false;
        }
        zone = myZone[zoneIndex++];
        return true;
    }
} // End of ZoneGenerator.

// This sample demonstrates the IsSubsetOf, Union, Intersect,
// Copy, ToXml and FromXml methods
// of the ZoneIdentityPermission class.
import System.*;
import System.Security.*;
import System.Security.Permissions .* ;

/** @assembly CLSCompliant(true)
 */

public class ZoneIdentityDemo
{
    // IsSubsetOf determines whether the current permission
    // is a subset of the specified permission.
    private boolean IsSubsetOfDemo()
    {
        boolean returnValue = true;
        SecurityZone zone1[] = new SecurityZone[1];
        SecurityZone zone2[] = new SecurityZone[1];
        ZoneIdentityPermission zoneIdPerm1[] = new ZoneIdentityPermission[1];
        ZoneIdentityPermission zoneIdPerm2[] = new ZoneIdentityPermission[1];
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();

        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(zoneIdPerm1, zone1)) {
            if (zoneIdPerm1[0] == null) {
                continue;
            }
            zoneGen2.ResetIndex();
            Console.WriteLine("****************************" 
                + "****************************\n");
            while (zoneGen2.CreateZone(zoneIdPerm2, zone2)) {
                if (zoneIdPerm2[0] == null) {
                    continue;
                }

                try {
                    if (zoneIdPerm1[0].IsSubsetOf(zoneIdPerm2[0])) {
                        Console.WriteLine((zoneIdPerm1[0].get_SecurityZone() 
                            + " is a subset of " 
                            + zoneIdPerm2[0].get_SecurityZone()));
                    }
                    else {
                        Console.WriteLine((zoneIdPerm1[0].get_SecurityZone() 
                            + " is not a subset of " + 
                        zoneIdPerm2[0].get_SecurityZone()));
                    }
                }
                catch (System.Exception e) {
                    Console.WriteLine(("An exception was thrown for subset :" 
                        + zoneIdPerm1[0] + "\n" + zoneIdPerm2[0] + "\n" + e));
                    returnValue = false;
                }
            }
        }
        return returnValue;
    } //IsSubsetOfDemo

    // Union creates a new permission that is the union of the
    // current permission and the specified permission.
    private boolean UnionDemo()
    {
        boolean returnValue = true;
        SecurityZone zone1[] = new SecurityZone[1];
        SecurityZone zone2[] = new SecurityZone[1];
        ZoneIdentityPermission zoneIdPerm1[] = new ZoneIdentityPermission[1];
        ZoneIdentityPermission zoneIdPerm2[] = new ZoneIdentityPermission[1];
        IPermission zoneIdPerm3;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();

        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(zoneIdPerm1, zone1)) {
            if (zoneIdPerm1[0] == null) {
                continue;
            }
            Console.WriteLine("***************************************" 
                + "*******************\n");
            zoneGen2.ResetIndex();
            while (zoneGen2.CreateZone(zoneIdPerm2, zone2)) {
                if (zoneIdPerm2[0] == null) {
                    continue;
                }
                zoneIdPerm3 = ((ZoneIdentityPermission)(zoneIdPerm1[0].
                    Union(zoneIdPerm2[0])));
                zoneIdPerm3 = zoneIdPerm1[0].Union(zoneIdPerm2[0]);
                if (zoneIdPerm3 == null) {
                    Console.WriteLine(("The union of " + zone1[0] + " and " 
                        + zone2[0] + " is null."));
                }
                else {
                    Console.WriteLine(("The union of " + zoneIdPerm1[0].
                    get_SecurityZone() + " and " 
                        + zoneIdPerm2[0].get_SecurityZone() + " = " 
                        + ((ZoneIdentityPermission)(zoneIdPerm3)).
                        get_SecurityZone().ToString()));
                }
            }
        }
        return returnValue;
    } //UnionDemo

    // Intersect creates and returns a new permission that
    // is the intersection of the current
    // permission and the permission specified.
    private boolean IntersectDemo()
    {
        boolean returnValue = true;
        SecurityZone zone1[] = new SecurityZone[1];
        SecurityZone zone2[] = new SecurityZone[1];
        ZoneIdentityPermission zoneIdPerm1[] = new ZoneIdentityPermission[1];
        ZoneIdentityPermission zoneIdPerm2[] = new ZoneIdentityPermission[1];
        ZoneIdentityPermission zoneIdPerm3 = null;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();

        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(zoneIdPerm1, zone1)) {
            if (zoneIdPerm1[0] == null) {
                continue;
            }
            Console.WriteLine("**********************************" 
                + "************************\n");
            zoneGen2.ResetIndex();
            while (zoneGen2.CreateZone(zoneIdPerm2, zone2)) {
                if (zoneIdPerm2[0] == null) {
                    continue;
                }
                zoneIdPerm3 = ((ZoneIdentityPermission)(zoneIdPerm1[0].
                    Intersect(zoneIdPerm2[0])));
                if (zoneIdPerm3 != null) {
                    Console.WriteLine(("The intersection of " + zone1[0] 
                        + " and " + zone2[0] + " = " + 
                        ((ZoneIdentityPermission)(zoneIdPerm3)).
                        get_SecurityZone().ToString()));
                }
                else {
                    Console.WriteLine(("The intersection of " + zone1[0] 
                        + " and " + zone2[0] + " is null."));
                }
            }
        }
        return returnValue;
    } //IntersectDemo

    //Copy creates and returns an identical copy of the current permission.
    private boolean CopyDemo()
    {
        boolean returnValue = true;
        SecurityZone zone1[] = new SecurityZone[1];
        ZoneIdentityPermission zoneIdPerm1[] = new ZoneIdentityPermission[1];
        ZoneIdentityPermission zoneIdPerm2 = null;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();

        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(zoneIdPerm1, zone1)) {
            if (zoneIdPerm1[0] == null) {
                continue;
            }
            zoneGen2.ResetIndex();
            Console.WriteLine("**********************************" 
                + "**********************\n");
            try {
                zoneIdPerm2 = ((ZoneIdentityPermission)(zoneIdPerm1[0].Copy()));
                Console.WriteLine(("Result of copy = " 
                    + zoneIdPerm2.ToString()));
            }
            catch (System.Exception e) {
                Console.WriteLine(("Copy failed :" 
                    + zoneIdPerm1[0].ToString() + e));
                continue;
            }
        }
        return returnValue;
    } //CopyDemo

    // 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 boolean ToFromXmlDemo()
    {
        boolean returnValue = true;
        SecurityZone zone1[] = new SecurityZone[1];
        ZoneIdentityPermission zoneIdPerm1[] = new
        ZoneIdentityPermission[1];
        ZoneIdentityPermission zoneIdPerm2 = null;
        ZoneGenerator zoneGen1 = new ZoneGenerator();
        ZoneGenerator zoneGen2 = new ZoneGenerator();

        zoneGen1.ResetIndex();
        while (zoneGen1.CreateZone(zoneIdPerm1, zone1)) {
            if (zoneIdPerm1[0] == null) {
                continue;
            }
            Console.WriteLine("*********************************" 
                + "***********************\n");
            zoneGen2.ResetIndex();
            try {
                zoneIdPerm2 = new ZoneIdentityPermission(PermissionState.None);
                zoneIdPerm2.FromXml(zoneIdPerm1[0].ToXml());
                Console.WriteLine(("Result of ToFromXml = " 
                    + zoneIdPerm2.ToString()));
            }
            catch (System.Exception e) {
                Console.WriteLine(("ToFromXml failed :" 
                    + zoneIdPerm1[0].ToString() + e));
                continue;
            }
        }
        return returnValue;
    } //ToFromXmlDemo

    // Invoke all demos.
    public boolean RunDemo()
    {
        boolean returnCode = true;
        boolean tempReturnCode;

        // Call the IsSubsetOf demo.
        if (tempReturnCode = IsSubsetOfDemo()) {
            Console.get_Out().WriteLine("IsSubsetOf demo " 
                + "completed successfully.");
        }
        else {
            Console.get_Out().WriteLine("IsSubsetOf demo failed.");
        }
        returnCode = tempReturnCode && returnCode;

        // Call the Union demo.
        if (tempReturnCode = UnionDemo()) {
            Console.get_Out().WriteLine("Union demo completed successfully.");
        }
        else {
            Console.get_Out().WriteLine("Union demo failed.");
        }

        returnCode = tempReturnCode && returnCode;

        // Call the Intersect demo.
        if (tempReturnCode = IntersectDemo()) {
            Console.get_Out().WriteLine("Intersect demo " 
                + " completed successfully.");
        }
        else {
            Console.get_Out().WriteLine("Intersect demo failed.");
        }
        returnCode = tempReturnCode && returnCode;

        // Call the Copy demo.
        if (tempReturnCode = CopyDemo()) {
            Console.get_Out().WriteLine("Copy demo completed successfully.");
        }
        else {
            Console.get_Out().WriteLine("Copy demo failed.");
        }
        returnCode = tempReturnCode && returnCode;

        // Call the ToFromXml demo.
        if (tempReturnCode = ToFromXmlDemo()) {
            Console.get_Out().WriteLine("ToFromXml demo " 
                + "completed successfully.");
        }
        else {
            Console.get_Out().WriteLine("ToFromXml demo failed.");
        }
        returnCode = tempReturnCode && returnCode;
        return returnCode;
    } //RunDemo

    // Test harness.
    public static void main(String[] args)
    {
        try {
            ZoneIdentityDemo democase = new ZoneIdentityDemo();
            boolean returnCode = democase.RunDemo();
            if (returnCode) {
                Console.get_Out().WriteLine("ZoneIdentityPermission" 
                    + " demo completed successfully.");
                Console.get_Out().WriteLine("Press the Enter key to exit.");
                String consoleInput = Console.ReadLine();
                Environment.set_ExitCode(100);
            }
            else {
                Console.get_Out().WriteLine("ZoneIdentityPermission" 
                    + " demo failed.");
                Console.get_Out().WriteLine("Press the Enter key to exit.");
                String consoleInput = Console.ReadLine();
                Environment.set_ExitCode(101);
            }
        }
        catch (System.Exception e) {
            Console.get_Out().WriteLine("ZoneIdentityPermission demo failed.");
            Console.WriteLine(e.ToString());
            Console.get_Out().WriteLine("Press the Enter key to exit.");
            String consoleInput = Console.ReadLine();
            Environment.set_ExitCode(101);
        }
    } //main
} //ZoneIdentityDemo

// This class generates ZoneIdentityPermission objects.
class ZoneGenerator
{
    private SecurityZone myZone[] =  { 
        SecurityZone.NoZone, SecurityZone.Internet, SecurityZone.Intranet, 
        SecurityZone.MyComputer, SecurityZone.Untrusted, SecurityZone.Trusted };

    private int zoneIndex = 0;

    public ZoneGenerator()
    {
        ResetIndex();
    } //ZoneGenerator

    public void ResetIndex()
    {
        zoneIndex = 0;
    } //ResetIndex

    // CreateZone creates ZoneIdentityPermission objects.
    public boolean CreateZone(ZoneIdentityPermission zonePerm[], 
        SecurityZone zone[])
    {
        if (zoneIndex >= myZone.length) {
            zonePerm[0] = new ZoneIdentityPermission(PermissionState.None);

            zone[0] = SecurityZone.NoZone;
            zoneIndex++;
            return false;
        }
        zone[0] = myZone[zoneIndex++];

        try {
            zonePerm[0] = new ZoneIdentityPermission(zone[0]);
            return true;
        }
        catch (System.Exception e) {
            Console.WriteLine(("Cannot create ZoneIdentityPermission: " 
                + zone[0] + " " + e));
            zonePerm[0] = new ZoneIdentityPermission(PermissionState.None);
            zone[0] = SecurityZone.NoZone;
            return true;
        }
    } //CreateZone
} //ZoneGenerator 

System.Object
   System.Security.CodeAccessPermission
    System.Security.Permissions.ZoneIdentityPermission

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft