DBDataPermission.Add(String, String, KeyRestrictionBehavior) 方法
本文内容
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定连接字符串的访问权限添加到 DBDataPermission
的现有状态。
public:
virtual void Add(System::String ^ connectionString, System::String ^ restrictions, System::Data::KeyRestrictionBehavior behavior);
C#
public virtual void Add(string connectionString, string restrictions, System.Data.KeyRestrictionBehavior behavior);
abstract member Add : string * string * System.Data.KeyRestrictionBehavior -> unit
override this.Add : string * string * System.Data.KeyRestrictionBehavior -> unit
Public Overridable Sub Add (connectionString As String, restrictions As String, behavior As KeyRestrictionBehavior)
- connectionString
- String
允许的连接字符串。
- restrictions
- String
标识允许使用或禁用的连接字符串参数的字符串。
- behavior
- KeyRestrictionBehavior
KeyRestrictionBehavior 属性之一。
在实现以下情况下,此方法非常有用:
.NET Framework 数据提供程序。
必须断言数据访问权限的 API。
必须修改安全策略的管理工具或安装程序。
如果指定了多个规则,则会选择限制性更高的规则。
适用于
产品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Framework | 1.1, 2.0, 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 |