如何:为 ClickOnce 应用程序设置安全区域How to: Set a security zone for a ClickOnce application

为 ClickOnce 应用程序设置代码访问安全权限时,需要在“项目设计器” **** 的“安全” **** 页上从基本权限集开始。When setting code access security permissions for a ClickOnce application, you need to start with a base set of permissions on the Security page of the Project Designer.

在大多数情况下,还可以选择包含受限权限集的“Internet” **** 区域,或选择包含较大权限集的“本地 Intranet” **** 区域。In most cases, you can also choose the Internet zone which contains a limited set of permissions, or the Local Intranet zone which contains a greater set of permissions. 如果应用程序需要自定义权限,则可以通过选择“自定义” **** 安全区域实现该操作。If your application requires custom permissions, you can do so by choosing the Custom security zone. 有关设置自定义权限的详细信息,请参阅 如何:设置 ClickOnce 应用程序的自定义权限For more information about setting custom permissions, see How to: Set Custom Permissions for a ClickOnce Application.

设置安全区域To set a security zone

  1. 解决方案资源管理器中选择一个项目后,在 " 项目 " 菜单上单击 " 属性"。With a project selected in Solution Explorer, on the Project menu click Properties.

  2. 单击“安全”选项卡。Click the Security tab.

  3. 选中“启用 ClickOnce 安全设置” **** 复选框。Select the Enable ClickOnce Security Settings check box.

  4. 选择“这是部分可信的应用程序” **** 选项按钮。Select the This is a partial trust application option button.

    “ClickOnce 安全权限” **** 部分中的控件已启用。The controls in the ClickOnce security permissions section are enabled.

  5. 在“将要从中安装应用程序的区域” **** 下拉列表中,选择一个安全区域。In the Zone your application will be installed from drop-down list, select a security zone.

另请参阅See also