Private Function killint(i,killstr,killsub) If Not IsNumeric(i) Then i=killstr ElseIf i<=0 Then i=killsub End if killint=Int(Left(i,5)) End Function
该函数功能很明确,不再繁琐说。
由于我们要通过积分判断用户级别,这里定义了一个私有函数:
Private Function getlevel() bpoint=killint(bpoint,0,0) If bpoint<500 Then blevel="初级会员" ElseIf bpoint>=500 And bpoint<=100 Then blevel="高级会员" Else blevel="终极会员" End If Getlevel=blevel End Function
我们要得是回送用户的信息,必须定义一个public公用函数,显示信息:
Public Function showuser() response.write("<h5>以下显示<font color=red>"&bname&"</font>的资料:</h5>") response.write("<h5>性别:<font color=red>"&bsex&"</font></h5>") response.write("<h5>积分:<font color=red>"&bpoint&"</font></h5>") getlevel response.write("<h5>级别:<font color=red>"&blevel&"</font></h5>") End Function End class
使用这个类的时候这样使用:(我在这里写了一个表单处理的)
Set blueideauser=new blueidea blueideauser.getname=Trim(request("id")) blueideauser.getsex=request("sex") blueideauser.getpoint=request("point") blueideauser.showuser