OleDbPermission 类

定义

启用用于 OLE DB 的 .NET Framework 数据提供程序,以帮助确保用户具有足够的安全级别来访问 OLE DB 数据源。Enables the .NET Framework Data Provider for OLE DB to help make sure that a user has a security level sufficient to access an OLE DB data source.

public ref class OleDbPermission sealed : System::Data::Common::DBDataPermission
[System.Serializable]
public sealed class OleDbPermission : System.Data.Common.DBDataPermission
type OleDbPermission = class
    inherit DBDataPermission
Public NotInheritable Class OleDbPermission
Inherits DBDataPermission
继承
属性

注解

此类用于在为部分信任方案启用 OLE DB 的 .NET Framework 数据提供程序时供将来使用。This class is intended for future use when the .NET Framework Data Provider for OLE DB is enabled for partial trust scenarios. OLE DB 的 .NET Framework 数据提供程序当前需要 FullTrust 权限。The .NET Framework Data Provider for OLE DB currently requires FullTrust permission. 目前,使用 OleDbPermission 类无效。Currently, using the OleDbPermission class has no effect. 有关更多信息,请参见 Code Access Security and ADO.NETFor more information, see Code Access Security and ADO.NET.

构造函数

OleDbPermission()

初始化 OleDbPermission 类的新实例。Initializes a new instance of the OleDbPermission class.

OleDbPermission(PermissionState)

初始化 OleDbPermission 类的新实例。Initializes a new instance of the OleDbPermission class.

OleDbPermission(PermissionState, Boolean)

初始化 OleDbPermission 类的新实例。Initializes a new instance of the OleDbPermission class.

属性

AllowBlankPassword

获取一个值,该值指示是否允许使用空白密码。Gets a value indicating whether a blank password is allowed.

(继承自 DBDataPermission)
Provider

此属性已被标记为过时。This property has been marked as obsolete. 设置此属性将不会产生任何作用。Setting this property will have no effect.

方法

Add(String, String, KeyRestrictionBehavior)

将指定连接字符串的访问权限添加到 DBDataPermission 的现有状态。Adds access for the specified connection string to the existing state of the DBDataPermission.

(继承自 DBDataPermission)
Assert()

声明调用代码能够通过调用此方法的代码,访问受权限请求保护的资源,即使未对堆栈中处于较高位置的调用方授予访问该资源的权限。Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. 使用 Assert() 会引起安全问题。Using Assert() can create security issues.

(继承自 CodeAccessPermission)
Clear()

移除以前使用 Add(String, String, KeyRestrictionBehavior) 方法添加的所有权限。Removes all permissions that were previous added using the Add(String, String, KeyRestrictionBehavior) method.

(继承自 DBDataPermission)
Copy()

OleDbPermission 形式返回 IPermissionReturns the OleDbPermission as an IPermission.

CreateInstance()

创建 DBDataPermission 类的新实例。Creates a new instance of the DBDataPermission class.

(继承自 DBDataPermission)
Demand()

如果未对调用堆栈中处于较高位置的所有调用方授予当前实例所指定的权限,则在运行时强制 SecurityExceptionForces a SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance.

(继承自 CodeAccessPermission)
Deny()

防止处于调用堆栈较高位置的调用函数使用可以调用此方法来访问当前实例指定资源的代码。Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance.

(继承自 CodeAccessPermission)
Equals(Object)

确定指定的 CodeAccessPermission 对象是否等于当前的 CodeAccessPermissionDetermines whether the specified CodeAccessPermission object is equal to the current CodeAccessPermission.

(继承自 CodeAccessPermission)
FromXml(SecurityElement)
GetHashCode()

获取 CodeAccessPermission 对象的哈希代码,此代码适合在哈希算法和数据结构(例如哈希表)中使用。Gets a hash code for the CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table.

(继承自 CodeAccessPermission)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Intersect(IPermission)

返回一个 IPermission,这是当前 OleDbPermission 与指定目标 IPermission 的交集。Returns an IPermission that is the intersection of the current OleDbPermission and the specified target IPermission.

IsSubsetOf(IPermission)

返回一个值,该值指示当前的权限对象是否为指定权限对象的一个子集。Returns a value indicating whether the current permission object is a subset of the specified permission object.

(继承自 DBDataPermission)
IsUnrestricted()

返回一个值,该值指示在不了解权限语义的情况下是否可以将权限表示为无限制。Returns a value indicating whether the permission can be represented as unrestricted without any knowledge of the permission semantics.

(继承自 DBDataPermission)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
PermitOnly()

防止处于调用堆栈较高位置的调用函数使用此代码,此代码将调用此方法来访问除当前实例指定的资源以外的所有资源。Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance.

(继承自 CodeAccessPermission)
ToString()

创建并返回当前权限对象的字符串表示形式。Creates and returns a string representation of the current permission object.

(继承自 CodeAccessPermission)
ToXml()
Union(IPermission)

显式接口实现

IPermission.Demand() (继承自 CodeAccessPermission)
IStackWalk.Assert() (继承自 CodeAccessPermission)
IStackWalk.Demand() (继承自 CodeAccessPermission)
IStackWalk.Deny() (继承自 CodeAccessPermission)
IStackWalk.PermitOnly() (继承自 CodeAccessPermission)

适用于