当前位置:首页 > 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
%>

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!