Export (0) Print
Expand All

PermissionSet.RemovePermission Method

Removes a permission of a certain type from the set.

[Visual Basic]
Public Overridable Function RemovePermission( _
   ByVal permClass As Type _
) As IPermission
[C#]
public virtual IPermission RemovePermission(
 Type permClass
);
[C++]
public: virtual IPermission* RemovePermission(
 Type* permClass
);
[JScript]
public function RemovePermission(
   permClass : Type
) : IPermission;

Parameters

permClass
The Type of permission to delete.

Return Value

The permission removed from the set.

Example

[Visual Basic] 
' Remove FileIOPermission from the permission set.
ps5.RemovePermission(GetType(FileIOPermission))
Console.WriteLine("The last permission set after removing FileIOPermission = " & ps5.ToString())

[C#] 
// Remove FileIOPermission from the permission set.
ps5.RemovePermission(typeof(FileIOPermission));
Console.WriteLine("The last permission set after removing FileIOPermission = " 
    + ps5.ToString());

[C++] 
// Remove FileIOPermission from the permission set.
ps5->RemovePermission(__typeof(FileIOPermission));
Console::WriteLine(S"The last permission set after removing FileIOPermission = {0}",
   ps5);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

PermissionSet Class | PermissionSet Members | System.Security Namespace

Show:
© 2014 Microsoft