WebPermission.AcceptList Property returns accept permissions : WebPermission « Network Remote « VB.Net






WebPermission.AcceptList Property returns accept permissions

 

Imports System.Text.RegularExpressions
Imports System.Net
Imports System.Security.Permissions
Imports System.Collections
Imports System.Collections.Generic

Module Example
   Public Sub Main()

        Dim myWebPermission1 As New WebPermission(PermissionState.None)
        myWebPermission1.AddPermission(NetworkAccess.Connect, "http://www.microsoft.com/default.htm")
        myWebPermission1.AddPermission(NetworkAccess.Connect, "http://www.msn.com")
        myWebPermission1.Demand()


        Dim myEnum1 As IEnumerator = myWebPermission1.AcceptList
        While myEnum1.MoveNext()
           Console.WriteLine((ControlChars.Tab + "The URI is : " + myEnum1.Current))
        End While

   End Sub
End Module

   
  








Related examples in the same category

1.WebPermission Class
2.Get all the URIs with Accept permission
3.Create WebPermission with the access rights for the specified URI regular expression.
4.Create WebPermission class with the access rights for the specified URI.
5.Create WebPermission that passes all demands or fails all demands.
6.Adds URI with the access rights to the current WebPermission.
7.Adds URI string with the specified access rights to the current WebPermission.
8.WebPermission.FromXml creates a WebPermission from an XML encoding.
9.WebPermission.Intersect returns intersection of two WebPermission instances.
10.WebPermission.IsSubsetOf determines whether the current WebPermission is a subset of the specified object.
11.WebPermission.Union Method returns union between two instances of the WebPermission class.