Example #1
0
        string tokenRWAsync = "";// 标识请求的唯一令牌

        private void btnTestASync_Click(object sender, EventArgs e)
        {
            try
            {
                BeefWrapNet net = new BeefWrapNet();
                this.tokenRWAsync = NetUtility.GetNextToken();
                // 异步请求
                net.HttpPostRequestAsync(url + @"/app", this.tokenRWAsync, new RequestPreCallBack(RequestPreRWAsync), new RequestWriteCallBack(RequestWriteRWAsync), new ResponseReadCallBack(ResponseReadRWAsync), new MessageCallBack(MessageRWAsync));
            }
            catch { }
        }
Example #2
0
        string tokenUp = "";// 标识下载的唯一令牌

        private void btnUpFile_Click(object sender, EventArgs e)
        {
            this.btnUpFile.Enabled  = false;
            this.progressBar1.Value = 0;
            try
            {
                BeefWrapNet net = new BeefWrapNet();
                this.tokenUp = NetUtility.GetNextToken();
                // 异步上传
                net.HttpPostRequestAsync(upUrl, this.tokenUp, new RequestPreCallBack(RequestPreUp), new RequestWriteCallBack(RequestWriteUp), null, new MessageCallBack(MessageUp));
            }
            catch { }
            this.btnUpFile.Enabled = true;
        }