Now I plan to re-modify and optimize the report system I built for my company in my sophomore year. It uses ASP. To use object-oriented, you need classes. Fortunately, VBS supports it.
Copy the code as follows:<%
class MyClass
Dim var 'Public variables must use Dim
Private var2' Private variables do not require
Sub sub1
response.write var2
End Sub
Private Sub sub2
response.write var
End Sub
Sub SetVar(v)
var2=v
End Sub
end class
Set cls = new MyClass'To generate an object, use set
cls.SetVar(asd)
cls.var = 1
cls.sub1' has strong encapsulation and will not prompt that there is no permission. It will directly say that attributes or methods are not supported
%>