資源簡介
應用技術成熟的ASP.NET和SQL SERVER 架構來實現。讓用戶享受購物模式的便利性,為企業提供了新的途徑。它以網絡為基礎,幫助用戶和商家解決傳統購物模式的所出現的問題。降低企業和個人的成本將信息有效的共享,在提供安全的交易平臺下,是一種高效率可移植可擴展的分布式購物系統。本課題實現商品展示、用戶訂單管理、購物車功能和訂單提交功能以及后臺綜合功能管理模塊。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Web;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Data.SqlClient;
public?partial?class?_Default?:?System.Web.UI.Page
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
???????
????}
????protected?void?Button2_Click(object?sender?EventArgs?e)
????{
????????SqlConnection?conn?=?new?SqlConnection();
????????conn.ConnectionString?=?“Data?Source=HU-PC;initial?catalog=net課程設計;integrated?security=sspi“;
????????string?strUname?=?TextBox2.Text;
????????string?strpwd?=?TextBox3.Text;
????????string?strsql?=?“select?ident?from?userinfo?where?用戶名=‘“?+?strUname+“‘?and?密碼=‘“+strpwd+“‘“;
????????conn.Open();
????????SqlCommand?comm?=?new?SqlCommand(strsql?conn);
????????object?x?=?comm.ExecuteScalar();
????????int?intident;
????????if?(x?==?null)
????????{
????????????Label4.Text?=?“你輸入的用戶名或密碼不正確。“;
????????????Label4.ForeColor?=?System.Drawing.Color.Red;
????????????Session[“pass“]?=?null;
????????}
????????else
????????{
????????????Session[“pass“]?=?“right“;
????????????Session[“username“]?=?strUname;
????????????intident?=?(int)x;
????????????if?(intident?==?0)
????????????{
????????????????Label4.Text?=?““;
????????????????Response.Redirect(“master.aspx?name=“?+?TextBox2.Text);
????????????}
????????????else?if?(intident?==?1)???//普通會員
????????????{
????????????????Label4.Text?=?““;
????????????????Response.Redirect(“商品首頁.aspx?name=“?+?TextBox2.Text);
????????????}
????????}???
????????conn.Close();
????}
????protected?void?Button3_Click(object?sender?EventArgs?e)
????{
????????Response.Redirect(“register.aspx?name=“);
????}
}
- 上一篇:職工工資管理系統C#課程設計含數據庫
- 下一篇:C#操作excel
評論
共有 條評論