SOL9 2.0 Sample: CredentialsDialog

SOL9 2.0 Samples

1 Screenshot





2 Source code

/*
 * CredentialsDialog.cpp 
 * Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9
// 2009/04/10

#include <sol/CredentialsDialog.h>

void _tmain(int argc, TCHAR** argv)
{ 
    CredentialsDialog dialog;
    {
        //Use empty username and password strings.
        String username;
        String password;

        if (dialog.show(username, password, _T("Somewhere Server")) == ERROR_SUCCESS) {
            _tprintf(_T("Username = %s\n"), (const TCHAR*)username);
            _tprintf(_T("Password = %s\n"), (const TCHAR*)password);
            username.secureClear();
            password.secureClear();
        }
    }

    {
        //Use non-empty default username and password strings. 
        String username = _T("FooDomain\\User");
        String password = _T("1%$QweU9?[KL}");

        if (dialog.show(username, password, _T("FooDomain")) == ERROR_SUCCESS) {
            _tprintf(_T("Username = %s\n"), (const TCHAR*)username);
            _tprintf(_T("Password = %s\n"), (const TCHAR*)password);
            username.secureClear();
            password.secureClear();
        }
    }
}

Last modified: 11 Nov 2009

Copyright (c) 2009 Antillia.com ALL RIGHTS RESERVED.