basmisc.bas

来自「Control your PC with Mobile Phone-it con」· BAS 代码 · 共 36 行

BAS
36
字号
Attribute VB_Name = "basMisc"
Public Function NetSend(sName As String, sMessage As String) As Boolean
'This function will read machine names and send Message to teh corresponding Machine
Dim iPos As Integer
Dim iCount As Integer
Dim i As Integer
Dim iLen As Integer
Dim sMachine() As String
'
    NetSend = False
    If Trim(sName) = "" Then
        Exit Function
    End If
    iLen = Len(Trim(sName))
    iCount = 0
    'Get number of sustem names
    For i = 1 To iLen
        If InStr(i, sName, ",") <> 0 Then
            iCount = iCount + 1
            i = InStr(i, sName, ",")
        End If
    Next i
    If iCount = 0 Then
        Shell ("net send " & sName & " " & sMessage)
        Exit Function
    Else
        ReDim sMachine(iCount)
    End If
    sMachine = Split(sName, ",")
    For i = 0 To iCount
        Shell ("net send " & sMachine(i) & " " & sMessage)
    Next i
    NetSend = True
End Function

⌨️ 快捷键说明

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