OleDbPermission OleDbPermission OleDbPermission OleDbPermission Class

定义

启用用于 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() OleDbPermission() OleDbPermission()

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

OleDbPermission(PermissionState) OleDbPermission(PermissionState) OleDbPermission(PermissionState) OleDbPermission(PermissionState)

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

OleDbPermission(PermissionState, Boolean) OleDbPermission(PermissionState, Boolean) OleDbPermission(PermissionState, Boolean) OleDbPermission(PermissionState, Boolean)

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

属性

AllowBlankPassword AllowBlankPassword AllowBlankPassword AllowBlankPassword

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

(Inherited from DBDataPermission)
Provider Provider Provider Provider

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

方法

Add(String, String, KeyRestrictionBehavior) Add(String, String, KeyRestrictionBehavior) Add(String, String, KeyRestrictionBehavior) Add(String, String, KeyRestrictionBehavior)

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

(Inherited from DBDataPermission)
Assert() Assert() Assert() 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.

(Inherited from CodeAccessPermission)
Clear() Clear() Clear() Clear()

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

(Inherited from DBDataPermission)
Copy() Copy() Copy() Copy()

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

CreateInstance() CreateInstance() CreateInstance() CreateInstance()

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

(Inherited from DBDataPermission)
Demand() Demand() Demand() 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.

(Inherited from CodeAccessPermission)
Deny() Deny() Deny() 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.

(Inherited from CodeAccessPermission)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from CodeAccessPermission)
FromXml(SecurityElement) FromXml(SecurityElement) FromXml(SecurityElement) FromXml(SecurityElement)
GetHashCode() GetHashCode() GetHashCode() 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.

(Inherited from CodeAccessPermission)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
Intersect(IPermission) Intersect(IPermission) Intersect(IPermission) Intersect(IPermission)

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

IsSubsetOf(IPermission) IsSubsetOf(IPermission) IsSubsetOf(IPermission) IsSubsetOf(IPermission)

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

(Inherited from DBDataPermission)
IsUnrestricted() IsUnrestricted() IsUnrestricted() IsUnrestricted()

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

(Inherited from DBDataPermission)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
PermitOnly() PermitOnly() PermitOnly() 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.

(Inherited from CodeAccessPermission)
ToString() ToString() ToString() ToString()

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

(Inherited from CodeAccessPermission)
ToXml() ToXml() ToXml() ToXml()
Union(IPermission) Union(IPermission) Union(IPermission) Union(IPermission)

显式界面实现

IPermission.Demand() IPermission.Demand() IPermission.Demand() IPermission.Demand() Inherited from CodeAccessPermission
IStackWalk.Assert() IStackWalk.Assert() IStackWalk.Assert() IStackWalk.Assert() Inherited from CodeAccessPermission
IStackWalk.Demand() IStackWalk.Demand() IStackWalk.Demand() IStackWalk.Demand() Inherited from CodeAccessPermission
IStackWalk.Deny() IStackWalk.Deny() IStackWalk.Deny() IStackWalk.Deny() Inherited from CodeAccessPermission
IStackWalk.PermitOnly() IStackWalk.PermitOnly() IStackWalk.PermitOnly() IStackWalk.PermitOnly() Inherited from CodeAccessPermission

适用于