楼上的虫子,你提供的一段模块:
Public Const NERR_Success As Long = 0&
Public Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (Server As Any, yToName As Byte, yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long
Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Const MAX_RESOURCES = 256
Public Const NOT_A_CONTAINER = -1
Public Function Sendmsg(strTo As String, strFrom As String, strMessage As String) As Boolean
Dim bytTo() As Byte
Dim bytFrom() As Byte
Dim bytMsg() As Byte
Dim Name As String, Length As Long
Length = 255
Name = String(Length, 0)
GetComputerName Name, Length
Name = Left(Name, Length)
bytTo = strTo & vbNullChar
bytFrom = IIf(strFrom = "", Name, strFrom) & vbNullChar
bytMsg = strMessage & vbNullChar
Sendmsg = (NetMessageBufferSend(ByVal 0&, bytTo(0), ByVal 0&, bytMsg(0), UBound(bytMsg)) = NERR_Success)
End Function