mscorlib(4.0.0.0) API with additions
System.Net.WebPermission Class Reference

Controls rights to access HTTP Internet resources. More...

Inheritance diagram for System.Net.WebPermission:
[legend]
Collaboration diagram for System.Net.WebPermission:
[legend]

Public Member Functions

 WebPermission (PermissionState state)
 Creates a new instance of the T:System.Net.WebPermission class that passes all demands or fails all demands. More...
 
 WebPermission ()
 Creates a new instance of the T:System.Net.WebPermission class. More...
 
 WebPermission (NetworkAccess access, Regex uriRegex)
 Initializes a new instance of the T:System.Net.WebPermission class with the specified access rights for the specified URI regular expression. More...
 
 WebPermission (NetworkAccess access, string uriString)
 Initializes a new instance of the T:System.Net.WebPermission class with the specified access rights for the specified URI. More...
 
void AddPermission (NetworkAccess access, string uriString)
 Adds the specified URI string with the specified access rights to the current T:System.Net.WebPermission. More...
 
void AddPermission (NetworkAccess access, Regex uriRegex)
 Adds the specified URI with the specified access rights to the current T:System.Net.WebPermission. More...
 
bool IsUnrestricted ()
 Checks the overall permission state of the T:System.Net.WebPermission. More...
 
override IPermission Copy ()
 Creates a copy of a T:System.Net.WebPermission. More...
 
override bool IsSubsetOf (IPermission target)
 Determines whether the current T:System.Net.WebPermission is a subset of the specified object. More...
 
override IPermission Union (IPermission target)
 Returns the logical union between two instances of the T:System.Net.WebPermission class. More...
 
override IPermission Intersect (IPermission target)
 Returns the logical intersection of two T:System.Net.WebPermission instances. More...
 
override void FromXml (SecurityElement securityElement)
 Reconstructs a T:System.Net.WebPermission from an XML encoding. More...
 
override SecurityElement ToXml ()
 Creates an XML encoding of a T:System.Net.WebPermission and its current state. More...
 
- Public Member Functions inherited from System.Security.CodeAccessPermission
void Demand ()
 Forces a T:System.Security.SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance. More...
 
void Assert ()
 Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. Using M:System.Security.CodeAccessPermission.Assert can create security issues. More...
 
void Deny ()
 Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance. More...
 
void PermitOnly ()
 Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance. More...
 
override string ToString ()
 Creates and returns a string representation of the current permission object. More...
 
override bool Equals (object obj)
 Determines whether the specified T:System.Security.CodeAccessPermission object is equal to the current T:System.Security.CodeAccessPermission. More...
 
override int GetHashCode ()
 Gets a hash code for the T:System.Security.CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table. More...
 

Properties

IEnumerator?? ConnectList [get]
 This property returns an enumeration of a single connect permissions held by this T:System.Net.WebPermission. The possible objects types contained in the returned enumeration are T:System.String and T:System.Text.RegularExpressions.Regex. More...
 
IEnumerator?? AcceptList [get]
 This property returns an enumeration of a single accept permissions held by this T:System.Net.WebPermission. The possible objects types contained in the returned enumeration are T:System.String and T:System.Text.RegularExpressions.Regex. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from System.Security.CodeAccessPermission
static void RevertAssert ()
 Causes any previous M:System.Security.CodeAccessPermission.Assert for the current frame to be removed and no longer in effect. More...
 
static void RevertDeny ()
 Causes any previous M:System.Security.CodeAccessPermission.Deny for the current frame to be removed and no longer in effect. More...
 
static void RevertPermitOnly ()
 Causes any previous M:System.Security.CodeAccessPermission.PermitOnly for the current frame to be removed and no longer in effect. More...
 
static void RevertAll ()
 Causes all previous overrides for the current frame to be removed and no longer in effect. More...
 

Detailed Description

Controls rights to access HTTP Internet resources.

Definition at line 11 of file WebPermission.cs.

Constructor & Destructor Documentation

◆ WebPermission() [1/4]

System.Net.WebPermission.WebPermission ( PermissionState  state)

Creates a new instance of the T:System.Net.WebPermission class that passes all demands or fails all demands.

Parameters
stateA T:System.Security.Permissions.PermissionState value.

Definition at line 87 of file WebPermission.cs.

◆ WebPermission() [2/4]

System.Net.WebPermission.WebPermission ( )

Creates a new instance of the T:System.Net.WebPermission class.

Definition at line 98 of file WebPermission.cs.

◆ WebPermission() [3/4]

System.Net.WebPermission.WebPermission ( NetworkAccess  access,
Regex  uriRegex 
)

Initializes a new instance of the T:System.Net.WebPermission class with the specified access rights for the specified URI regular expression.

Parameters
accessA T:System.Net.NetworkAccess value that indicates what kind of access to grant to the specified URI. F:System.Net.NetworkAccess.Accept indicates that the application is allowed to accept connections from the Internet on a local resource. F:System.Net.NetworkAccess.Connect indicates that the application is allowed to connect to specific Internet resources.
uriRegexA regular expression that describes the URI to which access is to be granted.

Definition at line 111 of file WebPermission.cs.

◆ WebPermission() [4/4]

System.Net.WebPermission.WebPermission ( NetworkAccess  access,
string  uriString 
)

Initializes a new instance of the T:System.Net.WebPermission class with the specified access rights for the specified URI.

Parameters
accessA NetworkAccess value that indicates what kind of access to grant to the specified URI. F:System.Net.NetworkAccess.Accept indicates that the application is allowed to accept connections from the Internet on a local resource. F:System.Net.NetworkAccess.Connect indicates that the application is allowed to connect to specific Internet resources.
uriStringA URI string to which access rights are granted.
Exceptions
T:System.ArgumentNullExceptionuriString is null.

Definition at line 121 of file WebPermission.cs.

Member Function Documentation

◆ AddPermission() [1/2]

void System.Net.WebPermission.AddPermission ( NetworkAccess  access,
string  uriString 
)

Adds the specified URI string with the specified access rights to the current T:System.Net.WebPermission.

Parameters
accessA T:System.Net.NetworkAccess that specifies the access rights that are granted to the URI.
uriStringA string that describes the URI to which access rights are granted.
Exceptions
T:System.ArgumentNullExceptionuriString is null.

Definition at line 136 of file WebPermission.cs.

◆ AddPermission() [2/2]

void System.Net.WebPermission.AddPermission ( NetworkAccess  access,
Regex  uriRegex 
)

Adds the specified URI with the specified access rights to the current T:System.Net.WebPermission.

Parameters
accessA NetworkAccess that specifies the access rights that are granted to the URI.
uriRegexA regular expression that describes the set of URIs to which access rights are granted.
Exceptions
T:System.ArgumentNullExceptionThe uriRegex parameter is null.

Definition at line 219 of file WebPermission.cs.

◆ Copy()

override IPermission System.Net.WebPermission.Copy ( )
virtual

Creates a copy of a T:System.Net.WebPermission.

Returns
A new instance of the T:System.Net.WebPermission class that has the same values as the original.

Implements System.Security.CodeAccessPermission.

Definition at line 287 of file WebPermission.cs.

◆ FromXml()

override void System.Net.WebPermission.FromXml ( SecurityElement  securityElement)
virtual

Reconstructs a T:System.Net.WebPermission from an XML encoding.

Parameters
securityElementThe XML encoding from which to reconstruct the T:System.Net.WebPermission.
Exceptions
T:System.ArgumentNullExceptionThe securityElement parameter is null.
T:System.ArgumentExceptionsecurityElement is not a permission element for this type.

Implements System.Security.CodeAccessPermission.

Definition at line 556 of file WebPermission.cs.

◆ Intersect()

override IPermission System.Net.WebPermission.Intersect ( IPermission  target)
virtual

Returns the logical intersection of two T:System.Net.WebPermission instances.

Parameters
targetThe T:System.Net.WebPermission to compare with the current instance.
Returns
A new T:System.Net.WebPermission that represents the intersection of the current instance and the target parameter. If the intersection is empty, the method returns null.
Exceptions
T:System.ArgumentExceptiontarget is not null or of type T:System.Net.WebPermission

Implements System.Security.CodeAccessPermission.

Definition at line 500 of file WebPermission.cs.

◆ IsSubsetOf()

override bool System.Net.WebPermission.IsSubsetOf ( IPermission  target)
virtual

Determines whether the current T:System.Net.WebPermission is a subset of the specified object.

Parameters
targetThe T:System.Net.WebPermission to compare to the current T:System.Net.WebPermission.
Returns
true if the current instance is a subset of the target parameter; otherwise, false. If the target is null, the method returns true for an empty current permission that is not unrestricted and false otherwise.
Exceptions
T:System.ArgumentExceptionThe target parameter is not an instance of T:System.Net.WebPermission.
T:System.NotSupportedExceptionThe current instance contains a Regex-encoded right and there is not exactly the same right found in the target instance.

Implements System.Security.CodeAccessPermission.

Definition at line 305 of file WebPermission.cs.

◆ IsUnrestricted()

bool System.Net.WebPermission.IsUnrestricted ( )

Checks the overall permission state of the T:System.Net.WebPermission.

Returns
true if the T:System.Net.WebPermission was created with the F:System.Security.Permissions.PermissionState.UnrestrictedT:System.Security.Permissions.PermissionState; otherwise, false.

Implements System.Security.Permissions.IUnrestrictedPermission.

Definition at line 280 of file WebPermission.cs.

◆ ToXml()

override SecurityElement System.Net.WebPermission.ToXml ( )
virtual

Creates an XML encoding of a T:System.Net.WebPermission and its current state.

Returns
A T:System.Security.SecurityElement that contains an XML-encoded representation of the T:System.Net.WebPermission, including state information.

Implements System.Security.CodeAccessPermission.

Definition at line 649 of file WebPermission.cs.

◆ Union()

override IPermission System.Net.WebPermission.Union ( IPermission  target)
virtual

Returns the logical union between two instances of the T:System.Net.WebPermission class.

Parameters
targetThe T:System.Net.WebPermission to combine with the current T:System.Net.WebPermission.
Returns
A T:System.Net.WebPermission that represents the union of the current instance and the target parameter. If either WebPermission is F:System.Security.Permissions.PermissionState.Unrestricted, the method returns a T:System.Net.WebPermission that is F:System.Security.Permissions.PermissionState.Unrestricted. If the target is null, the method returns a copy of the current T:System.Net.WebPermission.
Exceptions
T:System.ArgumentExceptiontarget is not null or of type T:System.Net.WebPermission.

Reimplemented from System.Security.CodeAccessPermission.

Definition at line 422 of file WebPermission.cs.

Property Documentation

◆ AcceptList

IEnumerator?? System.Net.WebPermission.AcceptList
get

This property returns an enumeration of a single accept permissions held by this T:System.Net.WebPermission. The possible objects types contained in the returned enumeration are T:System.String and T:System.Text.RegularExpressions.Regex.

Returns
The T:System.Collections.IEnumerator interface that contains accept permissions.

Definition at line 66 of file WebPermission.cs.

◆ ConnectList

IEnumerator?? System.Net.WebPermission.ConnectList
get

This property returns an enumeration of a single connect permissions held by this T:System.Net.WebPermission. The possible objects types contained in the returned enumeration are T:System.String and T:System.Text.RegularExpressions.Regex.

Returns
The T:System.Collections.IEnumerator interface that contains connect permissions.

Definition at line 44 of file WebPermission.cs.


The documentation for this class was generated from the following file: