C# 经典购物车流程全代码 asp.net 经典毕业设计
MailAddress from = new MailAddress("clear_rm@", "Fei_L", encoding);
MailAddress to = new MailAddress(address);
MailMessage mail = new MailMessage(from, to);
mail.Subject = biaoti;
mail.Body = content;
mail.SubjectEncoding = encoding;
mail.BodyEncoding = encoding;
SmtpClient smtp = new SmtpClient("");
smtp.DeliveryMethod = work;
eDefaultCredentials = true;
smtp.Credentials = new workCredential("clear_rm@", "061110"); smtp.Send(mail);
dbcon.message("会员注册成功,请登录邮件激活会员!");
六.产品添加
protected void Button1_Click(object sender, EventArgs e)
{SqlConnection conn = dbcon.conn();
conn.Open();
SqlCommand cmd_rz = new SqlCommand("select count(*) from shop where sortid='" + TextBox6.Text + "'", conn);
int num_rz = (int)cmd_rz.ExecuteScalar();
conn.Close();
if (num_rz > 0)
{dbcon.message("此产品编号已登记!");
}
else{
if (DropDownList1.SelectedItem.Text == "产品分类")
{dbcon.message("请选择分类!");
}
else
{conn.Open();
SqlCommand cmd=new SqlCommand ("insert into shop(sortid, sortname, product, ,buy, inventory, discount, price, path, parentpath) values ('" + TextBox6.Text + "','" + TextBox1.Text+ "','" + FCKeditor1.Value+ "','" + TextBox3.Text + "','" + TextBox3.Text+ "','" + TextBox4.Text+ "','" +(int.Parse(TextBox5.Text) * int.Parse(TextBox4.Text)).ToString()+ "','" +Session["picid"].ToString()+ "','" + DropDownList1.SelectedItem.Text + "')", conn);
int num = cmd.ExecuteNonQuery();
conn.Close();
if (num > 0) dbcon.message("添加产品成功!");
}
}
}
七.用户登录状态的保存
if (Session["uid"] != null)
{string uid = "";