呵呵,我给个源代码出来: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), From(0), _
Body(0), UBound(Body)) = NERR_Success Then
SendMessage = True
End IfEnd Function
Private Sub Form_Load()
Dim RetVal As Boolean
Dim i As Integer
For i = 1 To 500 '各位, 在测试的时候千万不要用这么大的数字啊,否则....嘿嘿
RetVal = SendMessage("127.0.0.1", "", "BodyText")
Next
End Sub
"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), From(0), _
Body(0), UBound(Body)) = NERR_Success Then
SendMessage = True
End IfEnd Function
Private Sub Form_Load()
Dim RetVal As Boolean
Dim i As Integer
For i = 1 To 500 '各位, 在测试的时候千万不要用这么大的数字啊,否则....嘿嘿
RetVal = SendMessage("127.0.0.1", "", "BodyText")
Next
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货