Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string bduss = textBox1.Text.Trim();

            if (bduss.Contains("BDUSS="))
            {
                // bduss = "BDUSS="+bduss;
                try
                {
                    User user = new User();
                    user.cookie = bduss;

                    if (!Common.CookToUn(ref user))
                    {
                        MessageBox.Show("无效的BDUSS", "提示");

                        return;
                    }
                    else
                    {
                        TaskForm fr2 = new TaskForm();

                        fr2.Text = "当前登陆账号:" + user.un;

                        user.tbs = HttpHelper.Tbs(bduss);
                        //  user= new User(un, "", bduss,);

                        fr2.user = user;


                        string userpath = Application.StartupPath + "\\User\\" + user.un;

                        if (!Directory.Exists(userpath))
                        {
                            Directory.CreateDirectory(userpath);
                        }


                        Common.Serialize <User>(user, userpath + "\\user.xml");
                        this.Hide();

                        fr2.ShowDialog();
                    }
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message, "提示");
                }
            }
            else
            {
                MessageBox.Show("请输入正确的BDUSS", "提示");
                textBox1.Clear();
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TaskForm ts = this.Owner as TaskForm;

            ts.listView3.Items[index].SubItems[0].Text = textBox1.Text;

            ts.listView3.Items[index].SubItems[1].Text = comboBox1.Text;

            ts.listView3.Items[index].SubItems[2].Text = comboBox2.Text;

            if (comboBox1.Text.Contains("关键词"))
            {
                ts.listView3.Items[index].SubItems[3].Text = "否";
            }
            else
            {
                ts.listView3.Items[index].SubItems[3].Text = comboBox3.Text;
            }

            MessageBox.Show("修改成功");
        }