class a{
function construct(){
echo "start to construct a obj\n";
}
function pide($a,$b)
{
//exit(1);//destruct called
return $a/$b; //destruct called when $b=0;
}
function add($a,$b)
{
throw new Exception ("daone");//destruct called
return $a+$b;
}
function destruct(){
echo "start to destruct\n";
}
}
try{
$first = new a();
//$r = $first->pide(4,0);
$first->add(4,0);
}
catch(Exception $e)
{
echo "cath exception \n";
}从上面的例子可以看出,php抛出异常(不管外面有没有try catch),直接退出的情况下,都会调用析构函数。
可以实现用户的在线注册、登陆后可以添加图书、购买图书,可以对图书类别、出版社、价格等进行饼图分析默认帐号/密码:51aspx/51aspx该系统采用三层接口开发,App_Code下为三层结构的代码文件,适合三层入门者学习使用数据绑定控件使用的是GridView,顶部公用文件采用了UserControl用户控件调用DB_51aspx下为Sql数据库文件,附件即可【该源码由51aspx提供】










