Exemplo n.º 1
0
        private void btnSrch_Click(object sender, EventArgs e)
        {
            if (edtPhone.Text == "")
            {
                MessageBox.Show("请输入您要查询的手机号码!");
                return;
            }
            if (edtPhone.Text.Length != 11)
            {
                MessageBox.Show("您输入的手机号有误,请检查!");
                return;
            }
            ApiUtils apiGet = new ApiUtils();
            object   obj    = null;

            apiGet.ApiData_Get(PubApi.ApiTypeEnum.ApiMobileInfo, out obj, edtPhone.Text);
        }
Exemplo n.º 2
0
        private void btnSrch_Click(object sender, EventArgs e)
        {
            if (comKd.SelectedIndex < 0)
            {
                MessageBox.Show("请选择快递公司!");
                return;
            }
            if (edtKdh.Text == "")
            {
                MessageBox.Show("请输入快递单号!");
                return;
            }
            ComboxItem item   = comKd.SelectedItem as ComboxItem;
            ApiUtils   apiGet = new ApiUtils();
            object     obj    = null;

            if (apiGet.ApiData_Get(PubApi.ApiTypeEnum.ApiExpressInfo, out obj, item.Value, edtKdh.Text))
            {
                if (obj != null)
                {
                    apiDataObject.ExpressInfoObj dataInfo = obj as apiDataObject.ExpressInfoObj;
                    if (dataInfo.status != "200")
                    {
                        MessageBox.Show("查询失败!");
                        return;
                    }
                    else
                    {
                        string sNr = string.Empty;
                        for (int i = 0; i < dataInfo.data.Count; i++)
                        {
                            sNr += dataInfo.data[i].time + "\r\n";
                            sNr += dataInfo.data[i].context + "\r\n";
                            sNr += "------------------------------------------------------------------------\r\n";
                        }
                        memoNr.Text = sNr;
                    }
                }
            }
        }