protected void Btn_UpdateGoods_Click(object sender, EventArgs e) { string nick = ""; string session = ""; if (Request.Cookies["nick"] != null) { nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick"; session = Request.Cookies["nicksession"].Value; } else { nick = Session["snick"].ToString(); session = Session["ssession"].ToString(); } if (nick == "" || session == "") { Response.Write("请重新登录"); return; } GoodsService goodsDal = new GoodsService(); goodsDal.DeleteGoodsByNick(nick); IList <TaoBaoGoodsInfo> list = TopAPI.GetGoodsInfoListByNick(nick, session); foreach (TaoBaoGoodsInfo info in list) { goodsDal.InsertGoodsInfo(info, nick); } Response.Redirect("UserAddAds.aspx"); }