FileIOPermissionAttribute.Read 属性


获取或设置对字符串值所指定的文件或目录的读访问权限。Gets or sets read access for the file or directory specified by the string value.

 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



用于读访问的文件或目录的绝对路径。The absolute path of the file or directory for read access.


下面的示例将 Read 属性设置为授予对 Read 指定目录中文件的访问权限。The following example sets the Read property to grant Read access to files in the specified directory.

// Set the Read property.
// 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()


此属性设置单个文件或目录的访问权限。This property sets access for a single file or directory. 使用其他属性来指定其他文件和目录。Use additional attributes to specify additional files and directories.