LoginCheck


Description: Tests if login information is correct. This method will throw an exception if the information is incorrect.
Parameters: none
Return Value: none

Example in Visual Basic .Net

Try
        'create an instance of the proxy class
        Dim BTService As New Elementool.BugTrackingWse
        '(user name = "account\username")
        Dim token As New UsernameToken(MyAccountName & "\" & MyUserName, MyPassword, _
                                                                PasswordOption.SendHashed)
        BTService.RequestSoapContext.Security.Tokens.Add(token)
        BTService.RequestSoapContext.Security.Elements.Add(New MessageSignature(token))
        'this method does nothing but throws an exception if login info is incorrect
        BTService.LoginCheck()
Catch ex As Exception
        MsgBox("Login Failed!")
End Try

Example in C#

try
{
    //create an instance of the proxy class
    Elementool.BugTrackingWse BTService = new Elementool.BugTrackingWse();
    //(user name = "account\username")
    UsernameToken token = new UsernameToken(MyAccountName + "\\" + MyUserName, MyPassword, PasswordOption.SendHashed);
    BTService.RequestSoapContext.Security.Tokens.Add(token);
    BTService.RequestSoapContext.Security.Elements.Add(new MessageSignature(token));
    //this method does nothing but throws an exception if login info is incorrect
    BTService.LoginCheck();
}
catch (Exception ex)
{
    MessageBox.Show("Login Failed!");
}