WebBrowserPermission Constructors

Definition

Initializes a new instance of the WebBrowserPermission class.

Overloads

WebBrowserPermission()

Initializes a new instance of the WebBrowserPermission class.

WebBrowserPermission(PermissionState)

Initializes a new instance of the WebBrowserPermission class by specifying a permission state.

WebBrowserPermission(WebBrowserPermissionLevel)

Initializes a new instance of the WebBrowserPermission class by specifying the Web browser permission level.

WebBrowserPermission()

Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs

Initializes a new instance of the WebBrowserPermission class.

C#
public WebBrowserPermission();

Remarks

By default, the value of the Level property is set to Safe.

Applies to

.NET 10 (package-provided) och andra versioner
Produkt Versioner
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

WebBrowserPermission(PermissionState)

Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs

Initializes a new instance of the WebBrowserPermission class by specifying a permission state.

C#
public WebBrowserPermission(System.Security.Permissions.PermissionState state);

Parameters

state
PermissionState

An enumerated value of PermissionState.

Examples

The following code example shows how to create a WebBrowserPermission with a PermissionState value.

C#
WebBrowserPermission webBrowserPermission = new WebBrowserPermission(PermissionState.Unrestricted);

Remarks

If state is set to Unrestricted, the value of the Level property is set to Unrestricted. If state is set to None, the value of the Level property is set to None.

Applies to

.NET 10 (package-provided) och andra versioner
Produkt Versioner
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

WebBrowserPermission(WebBrowserPermissionLevel)

Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs
Source:
WebBrowserPermission.cs

Initializes a new instance of the WebBrowserPermission class by specifying the Web browser permission level.

C#
public WebBrowserPermission(System.Security.Permissions.WebBrowserPermissionLevel webBrowserPermissionLevel);

Parameters

webBrowserPermissionLevel
WebBrowserPermissionLevel

An enumerated value of WebBrowserPermissionLevel.

Examples

The following code example shows how to create a WebBrowserPermission with a WebBrowserPermissionLevel value.

C#
WebBrowserPermission webBrowserPermission = new WebBrowserPermission(WebBrowserPermissionLevel.None);

Applies to

.NET 10 (package-provided) och andra versioner
Produkt Versioner
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10