Example #1
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            btnLogin.Text = "Initializing...";
            //the two strings below must to be "" to generate right signature
            try
            {
                Sinawler.Properties.Settings settings = new Sinawler.Properties.Settings();

                _apiUserRelation.App_Key             = settings.appKeyForUserRelation;
                _apiUserRelation.App_Secret          = settings.appSecretForUserRelation;
                GlobalPool.MinSleepMsForUserRelation = settings.MinSleepMsForUserRelation;

                _apiUserInfo.App_Key             = settings.appKeyForUserInfo;
                _apiUserInfo.App_Secret          = settings.appSecretForUserInfo;
                GlobalPool.MinSleepMsForUserInfo = settings.MinSleepMsForUserInfo;

                _apiUserTag.App_Key             = settings.appKeyForUserTag;
                _apiUserTag.App_Secret          = settings.appSecretForUserTag;
                GlobalPool.MinSleepMsForUserTag = settings.MinSleepMsForUserTag;

                _apiStatus.App_Key             = settings.appKeyForStatus;
                _apiStatus.App_Secret          = settings.appSecretForStatus;
                GlobalPool.MinSleepMsForStatus = settings.MinSleepMsForStatus;

                _apiComment.App_Key             = settings.appKeyForComment;
                _apiComment.App_Secret          = settings.appSecretForComment;
                GlobalPool.MinSleepMsForComment = settings.MinSleepMsForComment;
            }
            catch
            {
                MessageBox.Show("Authentication failed! Please check appKey and appSecret values in .config file.");
                Application.Exit();
            }
            try
            {
                wbUserInfo.Url     = new Uri(_apiUserInfo.GetAuthorizationCodeURL());
                wbUserTag.Url      = new Uri(_apiUserTag.GetAuthorizationCodeURL());
                wbStatus.Url       = new Uri(_apiStatus.GetAuthorizationCodeURL());
                wbComment.Url      = new Uri(_apiComment.GetAuthorizationCodeURL());
                wbUserRelation.Url = new Uri(_apiUserRelation.GetAuthorizationCodeURL());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Application.Exit();
            }
        }
Example #2
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            btnLogin.Text = "Initializing...";
            //the two strings below must to be "" to generate right signature
            try
            {
                Sinawler.Properties.Settings settings = new Sinawler.Properties.Settings();

                _apiUserRelation.App_Key = settings.appKeyForUserRelation;
                _apiUserRelation.App_Secret = settings.appSecretForUserRelation;
                GlobalPool.MinSleepMsForUserRelation = settings.MinSleepMsForUserRelation;

                _apiUserInfo.App_Key = settings.appKeyForUserInfo;
                _apiUserInfo.App_Secret = settings.appSecretForUserInfo;
                GlobalPool.MinSleepMsForUserInfo = settings.MinSleepMsForUserInfo;

                _apiUserTag.App_Key = settings.appKeyForUserTag;
                _apiUserTag.App_Secret = settings.appSecretForUserTag;
                GlobalPool.MinSleepMsForUserTag = settings.MinSleepMsForUserTag;

                _apiStatus.App_Key = settings.appKeyForStatus;
                _apiStatus.App_Secret = settings.appSecretForStatus;
                GlobalPool.MinSleepMsForStatus = settings.MinSleepMsForStatus;

                _apiComment.App_Key = settings.appKeyForComment;
                _apiComment.App_Secret = settings.appSecretForComment;
                GlobalPool.MinSleepMsForComment = settings.MinSleepMsForComment;
            }
            catch
            {
                MessageBox.Show("Authentication failed! Please check appKey and appSecret values in .config file.");
                Application.Exit();
            }
            try
            {                
                wbUserInfo.Url = new Uri(_apiUserInfo.GetAuthorizationCodeURL());
                wbUserTag.Url = new Uri(_apiUserTag.GetAuthorizationCodeURL());
                wbStatus.Url = new Uri(_apiStatus.GetAuthorizationCodeURL());
                wbComment.Url = new Uri(_apiComment.GetAuthorizationCodeURL());
                wbUserRelation.Url = new Uri(_apiUserRelation.GetAuthorizationCodeURL());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Application.Exit();
            }
        }