Exemplo n.º 1
0
 /// <summary>
 /// Logout of the client.
 /// </summary>
 public void LogOut()
 {
     if (m_LiveClient != null)
     {
         m_LiveClient.EnsureLogout();
     }
     m_LiveClient = null;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Issues a call to get a Windows Live logon client.
        /// </summary>
        /// <param name="username">WinQual Username to log on with.</param>
        /// <param name="password">WinQual password.</param>
        private void initialiseLiveClient(String username, String password)
        {
            SecureString ss = new SecureString();

            password.ToList().ForEach((c) => ss.AppendChar(c));

            if (m_LiveClient != null)
            {
                m_LiveClient.EnsureLogout();
                m_LiveClient = null;
            }

            // Attempt login the credentials to ensure they are
            // valid at service startup. If the credentials
            // are not valid, the service will stop.
            m_LiveClient = new HttpLiveClient(username, ss);
            m_LiveClient.EnsureLogin();
        }