コード例 #1
0
        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);
            }
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: SmugMugApi.cs プロジェクト: slgrobotics/QuakeMap
        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);
            }
        }
コード例 #4
0
ファイル: SmugMugApi.cs プロジェクト: slgrobotics/QuakeMap
        /// <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;
        }