麦田

不积跬步无以至千里.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string buttonText = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
            if (buttonText == "更新")
            {
                string url = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                string aid = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                string imageURL = "http://m119.mail.qq.com" + this.GetImageURL(url);
                string newImage = this.CreateImage(imageURL, aid);
                this.dataGridView1.Rows[e.RowIndex].Cells[7].Value = System.Drawing.Image.FromFile(newImage);
            }
            if (buttonText == "提交")
            {
                string userInput = this.dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString();
                if (userInput.Length != 4)
                {
                    MessageBox.Show("貌似你输入不正确");
                    return;
                }
                string url = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                string aid = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                Regex reg = new Regex("&re=(.+?)&");
                string re = this.RegStr(reg,url);
                Regex rego = new Regex("&sg=(.+?)$");
                string sg = this.RegStr(rego, url);




            }

 

posted on 2012-12-26 17:58  一些记录  阅读(24928)  评论(0)    收藏  举报