共用方式為


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

備註

這個屬性會設定單一檔案或目錄的存取權。 使用其他屬性來指定其他檔案和目錄。

適用於