AddInSecurityLevel Enumeração

Definição

Especifica o nível de confiança concedido ao domínio do aplicativo no qual um suplemento é carregado.Specifies the trust level that is granted to the application domain that an add-in is loaded into.

public enum class AddInSecurityLevel
[System.Serializable]
public enum AddInSecurityLevel
[<System.Serializable>]
type AddInSecurityLevel = 
Public Enum AddInSecurityLevel
Herança
AddInSecurityLevel
Atributos

Campos

FullTrust 2

Use o nível de segurança de confiança total para suplementos que têm permissão de leitura e gravação para o sistema de arquivos local, criar conexões de rede e ler do Registro.Use the full trust security level for add-ins that are allowed to read and write to the local file system, create network connections, and read from the registry. Esse nível de segurança concede acesso completo à CAS (segurança de acesso do código) do suplemento aplicando o campo Unrestricted.This security level grants full access to the add-in's code access security (CAS) by applying the Unrestricted field.

Host 3

Use o nível de segurança do host para fornecer ao suplemento as mesmas permissões concedidas atualmente para o código de hospedagem.Use the host security level to give the add-in the same permissions currently granted to the hosting code. Esta configuração tem duas finalidades:This setting has two purposes:

– Ela representa o conjunto máximo de permissões que um host pode conceder aos suplementos.- It represents the maximum permission set a host can grant to its add-ins.

– Ela permite que um host ClickOnce ou de aplicativo de navegador XAML propague o próprio site de origem para os próprios suplementos, o que permite contatar o servidor.- It allows a ClickOnce or an Extensible Application Markup Language (XAML) Browser Application (XBAP) host to propagate its site of origin to its add-ins, which enables them to contact the server.

Internet 0

Use o nível de segurança da Internet para suplementos que têm um nível de confiança baixo.Use the Internet security level for add-ins that have a low trust level.

Intranet 1

Use o nível de segurança da Intranet para suplementos que estão localizados na intranet da empresa.Use the Intranet security level for add-ins that are located on a company's intranet. Esses suplementos podem ter um nível de confiança maior porque os servidores e as informações estão dentro do firewall da empresa.These add-ins can have a greater trust level because the servers and information are within a company's firewall.

Exemplos

O exemplo a seguir ativa um suplemento com um nível de confiança especificado.The following example activates an add-in with a specified trust level.

//Ask the user which add-in they would like to use.
AddInToken selectedToken = ChooseAddIn(tokens);

//Activate the selected AddInToken in a new
//application domain with the Internet trust level.
Calculator CalcAddIn = selectedToken.Activate<Calculator>(AddInSecurityLevel.Internet);

//Run the add-in using a custom method.
RunCalculator(CalcAddIn);
'Ask the user which add-in they would like to use.
Dim selectedToken As AddInToken = ChooseAddIn(tokens)
'Activate the selected AddInToken in a new
'application domain with the Internet trust level.
Dim CalcAddIn As Calculator = selectedToken.Activate(Of Calculator)(AddInSecurityLevel.Internet)
'Run the add-in using a custom method.
RunCalculator(CalcAddIn)

Comentários

O sistema de suplemento ativa o suplemento com o conjunto de permissões que corresponde ao nível de confiança especificado para o domínio do aplicativo do suplemento.The add-in system activates the add-in with the permission set that corresponds to the trust level specified for the add-in's application domain. Esse conjunto de permissões é definido pela configuração de CAS (segurança de acesso ao código) do Common Language Runtime.That permission set is defined by the common language runtime's code access security (CAS) configuration.

Os valores dessa enumeração não podem ser combinados com o uso da operação OR.The values of this enumeration cannot be combined by using the bitwise OR operation.

Aplica-se a