xtd 0.2.0
Loading...
Searching...
No Matches

◆ password() [1/2]

const xtd::security::secure_string & xtd::diagnostics::process_start_info::password ( ) const
noexcept

Gets a secure string that contains the user password to use when starting the process.

Returns
The user password to use when starting the process.
Important
The xtd::diagnostics::process_start_info::working_directory property must be set if xtd::diagnostics::process_start_info::user_name and xtd::diagnostics::process_start_info::password are provided. If the property is not set, the default working directory is SYSTEMROOT%\system32.
Note
Setting the xtd::diagnostics::process_start_info::domain, xtd::diagnostics::process_start_info::user_name, and the xtd::diagnostics::process_start_info::password properties in a xtd::diagnostics::process_start_info object is the recommended practice for starting a process with user credentials.
Remarks
A xtd::security::secure_string object is like a xtd::string object in that it has a text value. However, the value of a xtd::security::secure_string object is automatically encrypted, it can be modified until your application marks it as read-only, and it can be deleted from computer memory by either your application.
Note
If you provide a value for the xtd::diagnostics::process_start_info::password property, the xtd::diagnostics::process_start_info::use_shell_execute property must be false, o an xtd::invalid_operation_exception will be thrown when the xtd::diagnostics::process::start(process_start_info) method is called.