Exemple #1
0
        private void skinComboBox3_Click(object sender, EventArgs e)
        {
            myComboboxItem ci = skinComboBox2.SelectedItem as myComboboxItem;

            if (ci == null)
            {
                MessageBox.Show("请选择市!");
                return;
            }
            skinComboBox3.Items.Clear();
            string pcode = ci.Value.ToString();
            string sendStr, rtnStr;

            sendStr = "getaddressinfo," + pcode;
            rtnStr  = func.sendToServer(sendStr);
            if (rtnStr.Contains("error"))
            {
                MessageBox.Show(rtnStr);
                return;
            }
            List <string> listinfo = func.GetStrlist(rtnStr, '|', false);

            foreach (string s in listinfo)
            {
                if (s.Length < 5)
                {
                    return;
                }
                string[] info = s.Split(',');

                ComboboxItem cTiem = new ComboboxItem();
                cTiem.Text = info[1]; cTiem.Value = info[0];
                skinComboBox3.Items.Add(cTiem);
            }
        }
Exemple #2
0
        private void add_yinpian_more_Load(object sender, EventArgs e)
        {
            string sendStr, rtnStr;

            sendStr = "getaddressinfo,0";
            rtnStr  = func.sendToServer(sendStr);
            if (rtnStr.Contains("error"))
            {
                MessageBox.Show(rtnStr);
                return;
            }
            List <string> listinfo = func.GetStrlist(rtnStr, '|', false);

            foreach (string s in listinfo)
            {
                if (s.Length < 10)
                {
                    return;
                }
                string[] info = s.Split(',');

                myComboboxItem ci = new myComboboxItem();
                ci.Text = info[1]; ci.Value = info[0];
                skinComboBox1.Items.Add(ci);
            }
        }