Transmitter5SetCredentials Method
Set user name and password required for the optional basic, digest, NTLM, or Kerberos authentication.
Namespace: SwissDecTXAssembly: SwissDecTX.Transmitter5 (in SwissDecTX.Transmitter5.dll) Version: 5.0.0.0 (5.0.0.0)
public void SetCredentials(
string userName,
string password
)
Public Sub SetCredentials (
userName As String,
password As String
)
public:
virtual void SetCredentials(
String^ userName,
String^ password
) sealed
function SetCredentials(userName, 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
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).
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);
}