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 { } }
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; }