Click or drag to resize

Transmitter5SetCredentials Method

Set user name and password required for the optional basic, digest, NTLM, or Kerberos authentication.

Namespace: SwissDecTX
Assembly: SwissDecTX.Transmitter5 (in SwissDecTX.Transmitter5.dll) Version: 5.0.0.0 (5.0.0.0)
Syntax
public void SetCredentials(
	string userName,
	string password
)

Parameters

userName  String
The user name needed to connect to the remote server
password  String
The password needed to connect to the remote server
Remarks
Network authentication is alluded to in the "SalaryDeclarationOverview" PDF document, page 91 (in the French edition, 20051202) along with the necessity to support SSL, digital signature and (optionally) point-to-point encryption (SwissDecTX supports all those options).
Example
Calling Transmitter.SetCredentials()
   using SwissDecTX;

// ...

       try {

           var tx = new Transmitter5();

           tx.SetCredentials("user", "password"); // SwissDecTX handles "HTTP 401 Unauthorized" and authenticates using these credentials

           // TODO: Set the certificates and / or URL, HTTP proxy... if needed

           // TODO: Use the transmitter...

       } catch (Exception ex) {

           MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

       }
See Also