/// <summary> /// 获取流水 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void button1_Click(object sender, EventArgs e) { WebResponseBase webResponseBase = await BankGatewayService.GetInformation(this.txb_userId.Text.Trim()); string urlText = "http://web.hkmdev.firstpay.com/phoenixFS-web/manage/showAccountQuery?reqId=web.p2p.member.info.manage-54df397e-39d0-4180-b3de-5972b4159ec4"; if (webResponseBase != null) { string url = $"http://fsgw.hkmdev.firstpay.com/phoenixFS-fsgw/gateway?data={HttpUtility.UrlEncode(webResponseBase.Data)}&tm={HttpUtility.UrlEncode(webResponseBase.Tm)}&merchantId={webResponseBase.MerchantId}"; //获取跳转后的数据 WebClient webClient = new WebClient(); byte[] htmlBytes = webClient.DownloadData(new Uri(urlText)); string c = Encoding.UTF8.GetString(htmlBytes); } MessageBox.Show("获取网关异常"); }
//http://jym-dev-sf.jinyinmao.com.cn/gateway/api/users/infomanage /// <summary> /// 获取网关数据 /// </summary> /// <returns></returns> public static async Task <WebResponseBase> GetInformation(string userId) { HttpResponseMessage httpResponseMesage = new HttpResponseMessage(); try { //记录下需要插入的资产ids httpResponseMesage = await InitialHttpClient().PostAsJsonAsync("api/users/infomanage", new { returnUrl = "http://www.baidu.com", userId, clientType = 900 }); WebResponseBase response = await httpResponseMesage.Content.ReadAsAsync <WebResponseBase>(); return(response); } catch (Exception ex) { //log记录日志 Logger.LoadData(@"BankError\Error.txt", ex.Message + "---------" + await httpResponseMesage.Content.ReadAsStringAsync()); return(null); } }