zoukankan      html  css  js  c++  java
  • VBS 类

    VBS类学习

    Class Student  '创建一个学生类

      Public sName '创建一个公有变量 学生名称

         Private sAge '创建一个私有变量  学生年龄

         Public Property Let SetSName(ByVal name) '定义公有的Let属性

        sName=name

         End Property

       Public Property Get GetSName() '定义公有的Set属性

        GetSName=sName       'VBS是弱类型的,将sName的赋值给GetSName返回

      End Property

      Private Sub Class_Initalize '设置类的初始化事件

        sAge=18

      End Sub

      Private Sub Class_terminate '设置类的清空事件

        Response.Write("类已经注销")

      End Sub

      Public Function GetStudent(ByVal name) 'Function过程可以有返回值

        call SetSName(name)

        GetStudent="姓名是"&GetSName&"年龄是"&sAge '&代表字符串拼接

      End Function

      Public Sub OutPutStudent() 'Sub过程没有返回值,但是可以调用系统的输入函数 InputBox  消息函数 MesBox 消息函数

        name=InputBox("请输入名称")

        call SetSName(name)

        Response.Write(姓名是"&GetSName&"年龄是"&sAge )  

      End Sub 

    End Class

  • 相关阅读:
    解决mongod端口占用问题
    MongoDB操作
    ssh 带密码私钥 输入密码
    sequence
    使用plsql导入dmp文件缺少imp*.exe
    oracle查看锁表进程,杀掉锁表进程
    oracle
    常用shell命令
    ORA-03113: end-of-file on & ORA-07445
    ORA-39126: Worker unexpected fatal error in KUPW$WORKER.PUT_DDLS
  • 原文地址:https://www.cnblogs.com/birchlee/p/1885100.html
Copyright © 2011-2022 走看看