activedog.cls

来自「获取操作系统启动权限」· CLS 代码 · 共 55 行

CLS
55
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ActiveDog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private ssDogKey As Long
Private iiTimeOut As Long
Dim sDogName As String

Public Property Get sDogKey() As Long
    sDogKey = ssDogKey
End Property

Friend Property Let sDogKey(dblNewBalance As Long)
    ssDogKey = dblNewBalance
End Property

Friend Property Get iTimeOut() As Long
    iTimeOut = iiTimeOut
End Property

Friend Property Let iTimeOut(dblNewBalance As Long)
    iiTimeOut = dblNewBalance
End Property

Public Function GetDogName() As String
    GetDogName = sDogName
End Function

Public Function LetDogName(ByVal strDogName As String)
    sDogName = strDogName
End Function

Public Function TellActive() As Boolean
    TellActive = bIsActive
    iiTimeOut = 0
    If frmMain.lstMsg.ListCount >= 10 Then frmMain.lstMsg.Clear
    frmMain.lstMsg.AddItem "标识为" & ssDogKey & ":" & sDogName & "的客户端连接 " & Now
End Function

Public Sub TellQuit()
    colDogs.Remove CStr(ssDogKey)
    If frmMain.lstMsg.ListCount >= 10 Then frmMain.lstMsg.Clear
    frmMain.lstMsg.AddItem "标识为" & ssDogKey & ":" & sDogName & "的客户端退出 " & Now
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?