public void LoginAnonymously() { try { proxy = (ISmugMug)XmlRpcProxyGen.Create(typeof(ISmugMug)); LoginResult result = proxy.LoginAnonymously(SMUGMUG_API_DEFAULT_VERSION, SMUGMUG_API_KEY); if (result.SessionID != null && result.SessionID.Length > 0) { this.credentials.SessionID = result.SessionID; this.connected = true; } else { throw new SmugMugException("SessionID was empty"); } } catch (Exception ex) { throw new SmugMugException("A login error occured, SessionID may be invalid.", ex.InnerException); } }
/// <summary> /// Initiates a session to SmugMug looging in the user using the emailAddress /// and password supplied in the constructor. /// </summary> /// <returns>True if the login was successfull.</returns> public bool Login() { if (this.connected == false | proxy == null && this.credentials.UserID == 0) { try { proxy = (ISmugMug)XmlRpcProxyGen.Create(typeof(ISmugMug)); this.credentials = proxy.LoginWithPassword(username, password, SMUGMUG_API_DEFAULT_VERSION, SMUGMUG_API_KEY); this.connected = true; } catch { return(false); } } else { LoginWithHash(); } return(true); }
/// <summary> /// Initiates a session to SmugMug looging in the user using the emailAddress /// and password supplied in the constructor. /// </summary> /// <returns>True if the login was successfull.</returns> public bool Login() { if (this.connected == false | proxy == null && this.credentials.UserID == 0) { try { proxy = (ISmugMug)XmlRpcProxyGen.Create(typeof(ISmugMug)); this.credentials = proxy.LoginWithPassword(username, password, SMUGMUG_API_DEFAULT_VERSION, SMUGMUG_API_KEY); this.connected = true; } catch { return false; } } else { LoginWithHash(); } return true; }