信息科学与工程学院
实验报告
附件:
实验报告说明
1.实验项目名称:要用最简练的语言反映实验的内容。要求与实验指导书中相一致。
2.实验类型:一般需说明是验证型实验还是设计型实验,是创新型实验还是综合型实验。
3.实验目的与要求:目的要明确,要抓住重点,符合实验指导书中的要求。
4.实验原理:简要说明本实验项目所涉及的理论知识。
5.实验环境:实验用的软硬件环境(配置)。
6.实验方案设计(思路、步骤和方法等):这是实验报告极其重要的内容。概括整个实验
过程。
对于操作型实验,要写明依据何种原理、操作方法进行实验,要写明需要经过哪几个步骤来实现其操作。
对于设计型和综合型实验,在上述内容基础上还应该画出流程图、设计思路和设计方法,再配以相应的文字说明。
对于创新型实验,还应注明其创新点、特色。
7.实验过程(实验中涉及的记录、数据、分析):写明具体上述实验方案的具体实施,包
括实验过程中的记录、数据和相应的分析。
8.结论(结果):即根据实验过程中所见到的现象和测得的数据,做出结论。
9.小结:对本次实验的心得体会、思考和建议。
10.指导教师评语及成绩:指导教师依据学生的实际报告内容,用简练语言给出本次实验报
告的评价和价值。
实验代码
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;
public partial class _Default : System.Web.UI.Page
{
CommonClass ccObj = new CommonClass();
GoodsClass gcObj = new GoodsClass();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
RefineBind();
HotBind();
DiscountBind();
}
}
//绑定市场价格
public string GetVarMKP(string strMarketPrice)
{
return ccObj.VarStr(strMarketPrice, 2);
}
//绑定热卖价格
public string GetVarHot(string strHotPrice)
{
return ccObj.VarStr(strHotPrice, 2);
}
protected void RefineBind()
{
gcObj.DLDeplayGI(1, this.dLRefine, "Refine");
}
protected void HotBind()
{
gcObj.DLDeplayGI(3, this.dlHot, "Hot");
}
protected void DiscountBind()
{
gcObj.DLDeplayGI(2, this.dlDiscount, "Discount");
}
public void AddressBack(DataListCommandEventArgs e)
{
Session["address"] = "";
Session["address"] = "Default.aspx";
Response.Redirect("~/showInfo.aspx?id=" + Convert.ToInt32(e.CommandArgument.ToString()));
}
protected void dLRefine_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "detailSee")
{
AddressBack(e);
}
else if (e.CommandName == "buy")
{
AddShopCart(e);
}
}
protected void dlDiscount_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "detailSee")
{
AddressBack(e);
}
else if (e.CommandName == "buy")
{
AddShopCart(e);
}
}
protected void dlHot_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "detailSee")
{
AddressBack(e);
}
else if (e.CommandName == "buy")
{
AddShopCart(e);
}
}
///
/// 向购物车中添加新商品
///
///
/// 获取或设置可选参数,
/// 该参数与关联的 CommandName
/// 一起被传递到 Command 事件。
///
public void AddShopCart(DataListCommandEventArgs e)
{
Hashtable hashCar;
if (Session["ShopCart"] == null)
{
//如果用户没有分配购物车
hashCar = new Hashtable(); //新生成一个
hashCar.Add(e.CommandArgument, 1); //添加一个商品
Session["ShopCart"] = hashCar; //分配给用户
}
else
{
//用户已经有购物车
hashCar = (Hashtable)Session["ShopCart"];//得到购物车的hash表
if (hashCar.Contains(e.CommandArgument))//购物车中已有此商品,商品数量加1
{
int count = Convert.ToInt32(hashCar[e.CommandArgument].ToString());//得到该商品的数量
hashCar[e.CommandArgument] = (count + 1);//商品数量加1
}
else
hashCar.Add(e.CommandArgument, 1);//如果没有此商品,则新添加一个项
}
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Manage_Login : System.Web.UI.Page
{
CommonClass ccObj = new CommonClass();
DBClass dbObj = new DBClass();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.labCode.Text =ccObj.RandomNum(4);//产生验证码
}
}
protected void btnLogin_Click(object sender, EventArgs e)
{
//判断用户是否已输入了必要的信息
if (this.txtAdminName.Text.Trim() == "" || this.txtAdminPwd.Text.Trim() == "")
{
Response.Write(ccObj.MessageBox("登录名和密码不能为空!"));
}
else
{
//判断用户输入的验证码是否正确
if (txtAdminCode.Text.Trim() == labCode.Text.Trim())
{
//定义一个字符串,获取用户信息
string strSql = "select * from tb_Admin where AdminName='"+this.txtAdminName.Text.Trim()+"' and Password='"+this.txtAdminPwd.Text.Trim()+"'";
DataTable dsTable=dbObj.GetDataSetStr(strSql, "tbAdmin");
if (dsTable.Rows.Count > 0)
{
Session["AID"] = Convert.ToInt32(dsTable.Rows[0][0].ToString());//保存用户ID
Session["AName"] = dsTable.Rows[0][1].ToString();//保存用户名
Response.Write("");
}
else
{
Response.Write(ccObj.MessageBox("您输入的用户名或密码错误,请重新输入!"));
}
}
else
{
Response.Write(ccObj.MessageBox("验证码输入有误,请重新输入!"));
}
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
Response.Write("");
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class feedback : System.Web.UI.Page
{
CommonClass ccObj = new CommonClass();
DBClass dbObj = new DBClass();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["UserName"] == null)
{
Response.Redirect("Default.aspx");
}
}
}
protected void btnOK_Click(object sender, EventArgs e)
{
if (Session["UserName"] == null)
{
Response.Redirect("Default.aspx");
}
else
{
string strSql = "INSERT INTO tb_LeaveWord(Uid,Subject,Content,DateTime,IP)";
strSql += " VALUES('" + Session["UserName"].ToString() + "','" + this.txtTitle.Text + "'";
strSql += ",'" + this.FreeTextBox1.Text + "','" + DateTime.Now + "'";
strSql += ",'" + Request.UserHostAddress + "')";
dbObj.ExecNonQuery(dbObj.GetCommandStr(strSql));
Response.Write(ccObj.MessageBox("添加成功!", "Default.aspx"));
}
}
protected void Button1_Click(object sender, EventArgs e)
{
this.txtTitle.Text = "";
this.FreeTextBox1.Text = "";
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("Default.aspx");
}
}
实验三B2B实验【实验前准备阶段】1.实验老师提前完成班级的注册,并进入管理员模式进行激活。2.提前一周时间让学生在相应的实验班级…
实验报告电子商务B2B实验20xx21班级0311002学号20xx2B2B交易实验报告B2B电子商务是企业与企业之间经过Inte…
电子商务实验报告范文实验一实施B2C平台进行网上购物一、实验目的掌握在网上使用网上银行、电子钱包、支付宝进行网上支付的操作。二、实…
B2B电子商务实验报告实验概述实验目的及要求1了解B2B实验中各个角色的功能和任务2掌握电子商务B2B系统的交易流程3掌握电子商务…
安徽财经大学实验报告电子商务概论实验报告安徽财经大学实验报告电子商务概论实验报告1安徽财经大学实验报告电子商务概论实验报告2安徽财…
完成电子商务实验课的心得体会通过这段时间的电子商务实验,我了解到很多关于电子商务的实践知识。伴随着商品经济和网络技术的不断发展,网…
关于电子商务B2B和B2C模式的实验心得当今世界网络、通信和信息技术快速发展,互联网在全球迅速普及,使得现代商业模式多样话。电子商…
电子商务实验心得体会这学期,学校安排了我们对于电子商务课程进行实际操作实习。通过老师的简单讲解和软件中提供的帮助,我基本了解了上机…
模拟电子商务B2C模式流程实验心得08级会计五班赵珂欣20xx420xx88在本学期末,电子商务课程由学校统一安排了电子商务模拟软…
电子商务实验心得体会我们通过四次实验,我基本掌握了电子商务的实际应用。对B2B及B2C的流程有了比较深入的了解,也有很多的收获。当…
电子商务实验总结报告姓名:年级:学号:实验时间20xx年x月至20xx年x月成绩一、实验的基本目的:电子商务是一门集理论性与实践性…