This documentation is archived and is not being maintained.

RegistryPermissionAttribute.Write Property

Gets or sets write access for the specified keys and values.

[Visual Basic]
Public Property Write As String
[C#]
public string Write {get; set;}
[C++]
public: __property String* get_Write();
public: __property void set_Write(String*);
[JScript]
public function get Write() : String;
public function set Write(String);

Property Value

A list of keys and values with paths for write access.

Example

[Visual Basic] 
' Set the Read, Write, Create, and All properties.
<RegistryPermissionAttribute(SecurityAction.PermitOnly, Read:="HKEY_LOCAL_MACHINE\HARDWARE"), _
RegistryPermissionAttribute(SecurityAction.PermitOnly, Write:="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION"), _
RegistryPermissionAttribute(SecurityAction.PermitOnly, _
    Create:="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System"), _
RegistryPermissionAttribute(SecurityAction.PermitOnly, _
    All:="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor")> _
Public Shared Sub PermitOnlyMethod()

[C#] 
[RegistryPermissionAttribute(SecurityAction.PermitOnly, 
     Write = "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION")]

[C++] 
[RegistryPermissionAttribute(SecurityAction::PermitOnly,
   Write = S"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION")]

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

RegistryPermissionAttribute Class | RegistryPermissionAttribute Members | System.Security.Permissions Namespace

Show: