5、GetSN.aspx.cs
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 Reg_forcool_NameSpace;
public partial class forcool_GetSN : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string Id = TextBox1.Text;
if (Id != "")
{
Reg_forcool_Class r_forcool_class = new Reg_forcool_Class();
TextBox2.Text = r_forcool_class.GetSN_Exterior(Id);
}
}
}
6、check_reg.aspx,检查是否注册程序,此程序可移植到其它用户必用的重要页面中。
7、check_reg.aspx.cs
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 Reg_forcool_NameSpace;
public partial class forcool_check_reg : System.Web.UI.Page
{
public void Check_Reg()
{
//检查注册开始
Reg_forcool_Class r_forcool_class = new Reg_forcool_Class();
//////////////////////////////////////////////////
string SN = "";
//在这里从数据库读取序列号,您需要自行添加代码实现此功能
//SN = 读取数据库返回的序列号
//////////////////////////////////////////////////
if (r_forcool_class.CheckReg(SN) == false)
{
//没有注册,强制注册,或者您也可以在此处添加代码以实现其它功能。
//Response.Redirect("Reg.aspx");
}
//检查注册结束
}
protected void Page_Load(object sender, EventArgs e)
{
Check_Reg(); //检查注册
}
}