我们都是木头人
,,
我们都是木头人
我 | 们 | 都 | 是 |
木 | 头 | 人 | 哈 |
哈 | 你 | 是 | 什么 |
人 | ? | ? | 。 |
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < dt_rwlist.Rows.Count; i++) { //获取晨光商品详情数据 string back = getwebcode("https://lifemg.cn/v4/h5/item/" + dt_rwlist.Rows[i].Cells["targetId"].Value, "UTF-8"); //将Json字符串转换成Json对象 JObject jObject = JsonConvert.DeserializeObject(back) as JObject; //返回数组 string ginfo = jObject["data"]["detailHtml"].ToString().Trim(); //解析获取返回的商品信息 //更新到商城数据库 string connectString = ConfigurationManager.ConnectionStrings["晨光采集器.Properties.Settings.OctUserGoodsShopSystemDBConnectionString"].ToString(); using (SqlConnection connection = new SqlConnection(connectString)) { connection.Open(); string updateQuery = "UPDATE Goo_GoodsMsg SET GoodsDesc = @goodsinfo WHERE GoodsID = @goodsid"; using (SqlCommand command = new SqlCommand(updateQuery, connection)) { command.Parameters.AddWithValue("@goodsinfo", ginfo); command.Parameters.AddWithValue("@goodsid", Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value)); int rowsAffected = command.ExecuteNonQuery(); } } listBox1.Items.Add(Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value) + ":已完成"); } MessageBox.Show("已完成下载任务"); }
,
我们都是木头人
,
,
我们都是木头人
我 | 们 | 都 | 是 |
木 | 头 | 人 | 哈 |
哈 | 你 | 是 | 什么 |
人 | ? | ? | 。 |
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < dt_rwlist.Rows.Count; i++) { //获取晨光商品详情数据 string back = getwebcode("https://lifemg.cn/v4/h5/item/" + dt_rwlist.Rows[i].Cells["targetId"].Value, "UTF-8"); //将Json字符串转换成Json对象 JObject jObject = JsonConvert.DeserializeObject(back) as JObject; //返回数组 string ginfo = jObject["data"]["detailHtml"].ToString().Trim(); //解析获取返回的商品信息 //更新到商城数据库 string connectString = ConfigurationManager.ConnectionStrings["晨光采集器.Properties.Settings.OctUserGoodsShopSystemDBConnectionString"].ToString(); using (SqlConnection connection = new SqlConnection(connectString)) { connection.Open(); string updateQuery = "UPDATE Goo_GoodsMsg SET GoodsDesc = @goodsinfo WHERE GoodsID = @goodsid"; using (SqlCommand command = new SqlCommand(updateQuery, connection)) { command.Parameters.AddWithValue("@goodsinfo", ginfo); command.Parameters.AddWithValue("@goodsid", Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value)); int rowsAffected = command.ExecuteNonQuery(); } } listBox1.Items.Add(Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value) + ":已完成"); } MessageBox.Show("已完成下载任务"); }
,
我们都是木头人
,
,
我们都是木头人
我 | 们 | 都 | 是 |
木 | 头 | 人 | 哈 |
哈 | 你 | 是 | 什么 |
人 | ? | ? | 。 |
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < dt_rwlist.Rows.Count; i++) { //获取晨光商品详情数据 string back = getwebcode("https://lifemg.cn/v4/h5/item/" + dt_rwlist.Rows[i].Cells["targetId"].Value, "UTF-8"); //将Json字符串转换成Json对象 JObject jObject = JsonConvert.DeserializeObject(back) as JObject; //返回数组 string ginfo = jObject["data"]["detailHtml"].ToString().Trim(); //解析获取返回的商品信息 //更新到商城数据库 string connectString = ConfigurationManager.ConnectionStrings["晨光采集器.Properties.Settings.OctUserGoodsShopSystemDBConnectionString"].ToString(); using (SqlConnection connection = new SqlConnection(connectString)) { connection.Open(); string updateQuery = "UPDATE Goo_GoodsMsg SET GoodsDesc = @goodsinfo WHERE GoodsID = @goodsid"; using (SqlCommand command = new SqlCommand(updateQuery, connection)) { command.Parameters.AddWithValue("@goodsinfo", ginfo); command.Parameters.AddWithValue("@goodsid", Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value)); int rowsAffected = command.ExecuteNonQuery(); } } listBox1.Items.Add(Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value) + ":已完成"); } MessageBox.Show("已完成下载任务"); }
,
我们都是木头人
,
,
我们都是木头人
我 | 们 | 都 | 是 |
木 | 头 | 人 | 哈 |
哈 | 你 | 是 | 什么 |
人 | ? | ? | 。 |
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < dt_rwlist.Rows.Count; i++) { //获取晨光商品详情数据 string back = getwebcode("https://lifemg.cn/v4/h5/item/" + dt_rwlist.Rows[i].Cells["targetId"].Value, "UTF-8"); //将Json字符串转换成Json对象 JObject jObject = JsonConvert.DeserializeObject(back) as JObject; //返回数组 string ginfo = jObject["data"]["detailHtml"].ToString().Trim(); //解析获取返回的商品信息 //更新到商城数据库 string connectString = ConfigurationManager.ConnectionStrings["晨光采集器.Properties.Settings.OctUserGoodsShopSystemDBConnectionString"].ToString(); using (SqlConnection connection = new SqlConnection(connectString)) { connection.Open(); string updateQuery = "UPDATE Goo_GoodsMsg SET GoodsDesc = @goodsinfo WHERE GoodsID = @goodsid"; using (SqlCommand command = new SqlCommand(updateQuery, connection)) { command.Parameters.AddWithValue("@goodsinfo", ginfo); command.Parameters.AddWithValue("@goodsid", Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value)); int rowsAffected = command.ExecuteNonQuery(); } } listBox1.Items.Add(Convert.ToString(dt_rwlist.Rows[i].Cells["GoodsID"].Value) + ":已完成"); } MessageBox.Show("已完成下载任务"); }