Private Declare Function NetMessageBufferSend Lib _ "NETAPI32.DLL" (yServer As Any, yToName As Byte, _ yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long Private Const NERR_Success As Long = 0& Public Function SendMessage(RcptToUser As String, _ FromUser As String, BodyMessage As String) As Boolean
Dim RcptTo() As Byte Dim From() As Byte Dim Body() As Byte RcptTo = RcptToUser & vbNullChar From = FromUser & vbNullChar Body = BodyMessage & vbNullChar If NetMessageBufferSend(ByVal 0&, RcptTo(0), ByVal 0&, _ Body(0), UBound(Body)) = NERR_Success Then SendMessage = True End IfEnd Function Private Sub Form_Load() Dim RetVal As Boolean RetVal = SendMessage("目标机器名", "FromUser机器名", "信息") End Sub参看我写的局域网消息发送器: http://www.csdn.net/cnshare/soft/16/16015.shtm
"NETAPI32.DLL" (yServer As Any, yToName As Byte, _
yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long
Private Const NERR_Success As Long = 0&
Public Function SendMessage(RcptToUser As String, _
FromUser As String, BodyMessage As String) As Boolean
Dim RcptTo() As Byte
Dim From() As Byte
Dim Body() As Byte RcptTo = RcptToUser & vbNullChar
From = FromUser & vbNullChar
Body = BodyMessage & vbNullChar If NetMessageBufferSend(ByVal 0&, RcptTo(0), ByVal 0&, _
Body(0), UBound(Body)) = NERR_Success Then
SendMessage = True
End IfEnd Function
Private Sub Form_Load()
Dim RetVal As Boolean
RetVal = SendMessage("目标机器名", "FromUser机器名", "信息")
End Sub参看我写的局域网消息发送器:
http://www.csdn.net/cnshare/soft/16/16015.shtm