Asp函数返回引用类型

Asp函数返回引用类型

 

<%
 set studentinstance = CreateStudent()
 if not isnull(studentinstance) then
     Response.write("StudentId:"&studentinstance.StudentId&"<Br/>")
     Response.write("StudentName:"&studentinstance.StudentName&"<Br/>")
 end if
 
 Function CreateStudent()
     set stud = new Statudent
     stud.StudentId=123
     stud.StudentName="Eric liu"
     set CreateStudent=stud
 End Function
 
 Class Statudent
  private id
  private name
 
  public property let StudentId(id_)
     id=id_
  end property
  public property get StudentId
     StudentId=id
  end property
 
  public property let StudentName(name_)
     name=name_
  end property
  public property get StudentName
     StudentName=name
  end property
 
 End Class
%>

posted @ 2010-03-13 19:39  Eric_Gq_Liu  阅读(188)  评论(0编辑  收藏  举报