示例#1
0
        private void http_OnResived(object sender, HttpSync.HttpSyncArgs e)
        {
            HttpSync httpSync = sender as HttpSync;

            if (httpSync != null)
            {
                httpSync.OnResived -= new EventHandler <HttpSync.HttpSyncArgs>(this.http_OnResived);
            }
            this.User.ErrorMsg = Login.CocosLoginMsg(e.Message);
            this.Resived(this.User);
        }
示例#2
0
        public void SyncLoginCocos(string name, string password)
        {
            this.User = new User()
            {
                UserName = name,
                PassWord = password
            };
            HttpSync httpSync = new HttpSync();

            httpSync.OnResived += new EventHandler <HttpSync.HttpSyncArgs>(this.http_OnResived);
            httpSync.GetSyncResponseOfString("https://passport.cocos.com/oauth/token/?" + this.User.CocosLoginData, "get", "");
        }
示例#3
0
        public void SyncLoginCocoaChina(string name, string password)
        {
            this.User = new User()
            {
                UserName = name,
                PassWord = password
            };
            HttpSync httpSync = new HttpSync();

            httpSync.OnResived += new EventHandler <HttpSync.HttpSyncArgs>(this.http_OnResived);
            httpSync.GetSyncResponseOfString("http://open.cocos.org/api/user_login", "post", this.User.LoginData);
        }