SmartFoxServer Silverlight API
SFSEvent..::.OnLoginDelegate Delegate
Namespaces ► SmartFoxClientAPI ► SFSEvent ► SFSEvent..::.OnLoginDelegate
Dispatched when the login to a SmartFoxServer zone has been attempted.
Declaration Syntax

C# | Visual Basic | Visual C++

    public delegate void OnLoginDelegate(
    	bool success,
    	string name,
    	string error
    )

    Public Delegate Sub OnLoginDelegate ( _
    	success As Boolean, _
    	name As String, _
    	error As String _
    )

    public delegate void OnLoginDelegate(
    	bool success,
    	String^ name,
    	String^ error
    )

Parameters

success (Boolean)
  the login result: true if the login to the provided zone succeeded; false if login failed.

name (String)
  the user's actual username.

error (String)
  the error message in case of login failure.

Remarks

NOTE:
the server sends the username back to the client because not all usernames are valid: for example, those containing bad words may have been filtered during the login process.

Version:
SmartFoxServer Basic / Pro

Examples
The following example shows how to handle the login result.
CopyC#

    SFSEvent.onLogin += OnLogin;

    smartFox.Login("simpleChat", "jack");

    public void OnLogin(bool success, string name, string error)
    {
        if (success)
            Debug.WriteLine("Successfully logged in as " + name);
        else
            Debug.WriteLine("Zone login error; the following error occurred: " + error);
    }

See Also
SFSEvent..::.OnLogoutDelegate
Login(String, String, String)

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)