利用WIN32 API函数NetMessageBufferSend()可以在一个Windows NT网络中广播一个消息。
Private Const NERR_Success As Long = 0&
Private 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 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
bytTo = strTo & VBNullChar
bytName = strFrom & vbNullChar
bytMsg = strMessage & vbNullChar
Sendmsg = (NetMessageBufferSend(ByVal 0&, yToName(0),ByVal 0&, yMsg(0), UBound(yMsg)) = NERR_Success)
End Function
上一篇: 在VB中用Outlook发电子邮件
下一篇: 在VB中使用UDP协议
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



