网络编程
位置:首页>> 网络编程>> Asp编程>> Asp 返回引用类型函数代码

Asp 返回引用类型函数代码

 来源:asp之家 发布时间:2011-03-10 10:44:00 

标签: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 
%> 

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com