|
技术资料 > ASP技术 > 客户端相关 : 将VB中的CLASS结合到VBscript中来 |
将VB中的CLASS结合到VBscript中来 March 25,2004 |
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Class clsTest
Private m_strTest
Private Sub Class_Initialize()
m_strTest = "VBScript Programming is fun!"
End Sub
Private Function PrivateTest(strTest)
PrivateTest = strReverse(strTest)
End Function
Public Property Get TestProperty()
TestProperty = m_strTest
End Property
Public Property Let TestProperty(strTest)
m_strTest = strTest
End Property
Public Sub Test()
m_strTest = PrivateTest(m_strTest)
End Sub
End Class
Dim objTest
Set objTest = New clsTest
Response.Write objTest.TestProperty & "<BR>"
objTest.Test
Response.Write objTest.TestProperty & "<BR>"
objTest.TestProperty = "Objects are cool!"
Response.Write objTest.TestProperty & "<BR>"
objTest.Test
Response.Write objTest.TestProperty & "<BR>"
Set objTest = Nothing
</SCRIPT> |
|
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved