IsolatedStorageFilePermission 类

定义

警告:已过时

Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}

指定私有虚拟文件系统的允许的用法。Specifies the allowed usage of a private virtual file system. 此类不能被继承。This class cannot be inherited.

public ref class IsolatedStorageFilePermission sealed : System::Security::Permissions::IsolatedStoragePermission
public sealed class IsolatedStorageFilePermission : System.Security.Permissions.IsolatedStoragePermission
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class IsolatedStorageFilePermission : System.Security.Permissions.IsolatedStoragePermission
[System.Serializable]
public sealed class IsolatedStorageFilePermission : System.Security.Permissions.IsolatedStoragePermission
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class IsolatedStorageFilePermission : System.Security.Permissions.IsolatedStoragePermission
type IsolatedStorageFilePermission = class
    inherit IsolatedStoragePermission
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type IsolatedStorageFilePermission = class
    inherit IsolatedStoragePermission
[<System.Serializable>]
type IsolatedStorageFilePermission = class
    inherit IsolatedStoragePermission
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type IsolatedStorageFilePermission = class
    inherit IsolatedStoragePermission
Public NotInheritable Class IsolatedStorageFilePermission
Inherits IsolatedStoragePermission
继承
IsolatedStorageFilePermission
属性

注解

公共语言运行时 (CLR) 使用此类来控制对独立存储的访问。The common language runtime (CLR) uses this class to control access to isolated storage.

独立存储为应用程序或组件创建使用的唯一存储区域。Isolated storage creates a unique storage area for use by an application or component. 它提供真正的隔离,因为应用程序的标识可以唯一确定虚拟文件系统的根,而只有该应用程序可以访问该文件。It provides true isolation in that the identity of an application uniquely determines the root of a virtual file system, which only that application can access. 因此,每个应用程序都有自己的自动分配给它的文件区域。Thus, each application has its own file area automatically assigned to it. 此文件区域与其他应用程序完全隔离,使其专用于该应用程序。This file area is fully isolated from other applications, making it private to that application.

备注

如果使用 AssertPermitOnlyDeny 为使用情况或配额添加堆栈修饰符,则不起作用。There is no effect if you use Assert, PermitOnly, or Deny to add stack modifiers for usage or quota. 使用情况和配额是通过证据确定的,并且不会对请求执行堆栈审核,这使得上述操作无效。Usage and quota are determined from evidence and a stack walk is not performed for demands, making the above operations ineffective.

构造函数

IsolatedStorageFilePermission(PermissionState)

根据指定,使用完全受限制或不受限制的权限初始化 IsolatedStorageFilePermission 类的新实例。Initializes a new instance of the IsolatedStorageFilePermission class with either fully restricted or unrestricted permission as specified.

属性

UsageAllowed

获取或设置允许的独立存储包含的类型。Gets or sets the type of isolated storage containment allowed.

(继承自 IsolatedStoragePermission)
UserQuota

获取或设置每位用户的总存储在总大小中的配额。Gets or sets the quota on the overall size of each user's total store.

(继承自 IsolatedStoragePermission)

方法

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)
Copy()

创建并返回当前权限的相同副本。Creates and returns an identical copy of the current permission.

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)

从 XML 编码重新构造具有指定状态的权限。Reconstructs a permission with a specified state from an XML encoding.

(继承自 IsolatedStoragePermission)
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)

创建并返回一个权限,该权限是当前权限与指定权限的交集。Creates and returns a permission that is the intersection of the current permission and the specified permission.

IsSubsetOf(IPermission)

确定当前权限是否为指定权限的子集。Determines whether the current permission is a subset of the specified permission.

IsUnrestricted()

返回一个值,该值指示当前权限是否不受限制。Returns a value indicating whether the current permission is unrestricted.

(继承自 IsolatedStoragePermission)
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()

创建权限及其当前状态的 XML 编码。Creates an XML encoding of the permission and its current state.

ToXml()

创建权限及其当前状态的 XML 编码。Creates an XML encoding of the permission and its current state.

(继承自 IsolatedStoragePermission)
Union(IPermission)

创建一个权限,该权限是当前权限与指定权限的并集。Creates a permission that is the union of the current permission and the specified permission.

显式接口实现

IPermission.Demand()

如果不满足安全要求,则会在运行时引发 SecurityExceptionThrows a SecurityException at run time if the security requirement is not met.

(继承自 CodeAccessPermission)
IStackWalk.Assert()

断言调用代码可以访问当前权限对象所标识的资源,即使尚未对堆栈中的高级调用方授予访问该资源的权限。Asserts that the calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.

(继承自 CodeAccessPermission)
IStackWalk.Demand()

在运行时确定调用堆栈中的所有调用方是否已被授予当前权限对象所指定的权限。Determines at run time whether all callers in the call stack have been granted the permission specified by the current permission object.

(继承自 CodeAccessPermission)
IStackWalk.Deny()

将导致通过调用代码传递的当前对象的每个 Demand() 失败。Causes every Demand() for the current object that passes through the calling code to fail.

(继承自 CodeAccessPermission)
IStackWalk.PermitOnly()

导致所有对象的每个 Demand()(除了通过调用代码的当前那个)失败,即使调用堆栈中较高级别的代码已被授予访问其他资源的权限也是如此。Causes every Demand() for all objects except the current one that pass through the calling code to fail, even if code higher in the call stack has been granted permission to access other resources.

(继承自 CodeAccessPermission)

适用于

另请参阅