FileIOPermissionAttribute.Write 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置对字符串值所指定的文件或目录的写访问权限。
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()
注解
此属性设置单个文件或目录的访问权限。 使用其他属性指定其他文件和目录。