共用方式為


FileIOPermissionAttribute.Write 屬性

定義

取得或設定字串值所指定檔案或目錄的寫入權限。

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

屬性值

寫入存取權的檔案或目錄絕對路徑。

範例

下列範例會 Write 設定 屬性,以授 Write 與指定目錄中檔案的存取權。

// Set the Write property.
[FileIOPermissionAttribute(SecurityAction::PermitOnly,
Write="C:\\Documents and Settings\\All Users\\Application Data\\Microsoft")]
// Set the Write property.
[FileIOPermissionAttribute(SecurityAction.PermitOnly,
     Write = "C:\\Documents and Settings\\All Users\\Application Data\\Microsoft")]
' 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()

備註

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

適用於