private void btnHGS_Click(object sender, EventArgs e) { string url = ConfigurationManager.AppSettings["httpurl"] + "GetSMS.aspx"; string args = ""; args += "User="******"&Pass="******"") { MessageBox.Show("请求接口失败!"); return; } GetSMSResult result = JsonConvert.DeserializeObject <GetSMSResult>(sr); dgv.DataSource = result.Msgs; MessageBox.Show(result.Result); }
private void btnWGS_Click(object sender, EventArgs e) { string url = ConfigurationManager.AppSettings["wsurl"] + "SMWebService.asmx"; string[] args = new string[2]; args[0] = txtAccount.Text; args[1] = txtPassword.Text; string sr = (string)WSHelper.InvokeWebService(url, "GetSMS", args); if (sr == "") { MessageBox.Show("请求接口失败!"); return; } GetSMSResult result = JsonConvert.DeserializeObject <GetSMSResult>(sr); dgv.DataSource = result.Msgs; MessageBox.Show(result.Result); }