Export (0) Print
Expand All

UrlIdentityPermission.Url Property

Gets or sets a URL representing the identity of Internet code.

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

public string Url { get; set; }

Property Value

Type: System.String
A URL representing the identity of Internet code.

ExceptionCondition
NotSupportedException

The URL cannot be retrieved because it has an ambiguous identity.

The complete URL is considered, including the protocol (HTTP, HTTPS, FTP) and the file, for example: http://www.fourthcoffee.com/process/grind.htm/.

URLs can be matched exactly or by a wildcard in the final position, for example: http://www.fourthcoffee.com/process/*.

The following code example shows the use of the Url property. This example is part of a larger example provided for UrlIdentityPermission class.

// Union creates a new permission that is the union of the current permission 
// and the specified permission. 
private static void UnionDemo()
{
    UrlIdentityPermission permIdPerm1 = new UrlIdentityPermission("http://www.fourthcoffee.com/process/");
    UrlIdentityPermission permIdPerm2 = new UrlIdentityPermission("http://www.fourthcoffee.com/*");
    UrlIdentityPermission p3 = (UrlIdentityPermission)permIdPerm1.Union(permIdPerm2);
    try
    {
        if (p3 != null)
        {
            Console.WriteLine("The union of " + permIdPerm1.Url +
                " and \n\t" + permIdPerm2.Url + " is \n\t"
                + p3.Url + "\n");

        }
        else
        {
            Console.WriteLine("The union of " + permIdPerm1.Url +
                " and \n\t" + permIdPerm2.Url + " is null.\n");
        }
    }
    catch (SystemException e)
    {
        Console.WriteLine("The union of " + permIdPerm1.Url +
                " and \n\t" + permIdPerm2.Url + " failed.");

        Console.WriteLine(e.Message);
    }

}

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

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft