FileIOPermissionAttribute.Read 属性

定义

获取或设置对字符串值所指定的文件或目录的读访问权限。

public:
 property System::String ^ Read { System::String ^ get(); void set(System::String ^ value); };
public string Read { get; set; }
member this.Read : string with get, set
Public Property Read As String

属性值

String

用于读访问的文件或目录的绝对路径。

示例

下面的示例将 Read 属性设置为授予对 Read 指定目录中文件的访问权限。

// Set the Read property.
[FileIOPermissionAttribute(SecurityAction::PermitOnly,Read="C:\\")]
// Set the Read property.
[FileIOPermissionAttribute(SecurityAction.PermitOnly, Read = "C:\\")]
' Set the Read, PathDiscovery, Append, Write, and All properties.
<FileIOPermissionAttribute(SecurityAction.PermitOnly, Read:="C:\"), _
FileIOPermissionAttribute(SecurityAction.PermitOnly, _
PathDiscovery:="C:\Documents and Settings\All Users"), _
FileIOPermissionAttribute(SecurityAction.PermitOnly, _
Append:="C:\Documents and Settings\All Users\Application Data"), _
FileIOPermissionAttribute(SecurityAction.PermitOnly, _
    Write:="C:\Documents and Settings\All Users\Application Data\Microsoft"), _
FileIOPermissionAttribute(SecurityAction.PermitOnly, _
    All:="C:\Documents and Settings\All Users\Application Data\Microsoft\Network")> _
Public Shared Sub PermitOnlyMethod()

注解

此属性设置单个文件或目录的访问权限。 使用其他属性来指定其他文件和目录。

适用于