Partager via


IMsTscNonScriptable::put_ClearTextPassword (Windows Embedded CE 6.0)

1/6/2010

This method sets the connection password for the Remote Desktop ActiveX control in clear-text format. You can also call this method to set a clear-text password before converting it to either a portable encoded password or to a binary (nonportable) encoded password.

Syntax

HRESULT put_ClearTextPassword(
  BSTR newClearTextPass
);

Parameters

  • newClearTextPass
    [in] Connection password, specified in clear-text format.

Return Value

The following table shows the return values for this method.

Value Description

S_OK

Password was correctly set.

E_FAIL

The control is already connected or in the connecting state.

nonzero error code

An error occurred.

Remarks

The password is passed to the server in the encrypted RDP communications channel. Once you set a clear-text password, you cannot retrieve it in clear-text format.

If you first call this method to set a password in clear-text format, you can then convert the password to encoded format.

To convert a clear-text password to encoded format

  1. Set the password in clear-text format by calling put_ClearTextPassword.

  2. To retrieve the password in binary (non-portable) encoded format, call get_BinaryPassword and get_BinarySalt. Both the encoded password part and the salt part are required to set a password in binary encoded format.

  3. To retrieve the password in portable encoded format, call get_PortablePassword and get_PortableSalt. Both parts are required to set a password in portable encoded format.

After following these steps, you can set the password in encoded format by calling put_BinaryPassword and put_BinarySalt, or put_PortablePassword and put_PortableSalt. Both calls are required.

To enable automatic logon, you must also set the UserName and Domain properties. If the password fails to authenticate the user, the Windows logon dialog box is displayed at the server to prompt the user for the password.

This property can be set only if the control is not in the connected state. The method returns E_FAIL if called when the control is connected. You can check if the control is connected by calling IMsTscAx::get_Connected.

Requirements

Header discodlg.h, mstsax.idl
Library Mstsax.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

IMsTscNonScriptable