如果有什么好的方法,请跟帖.
也可以发电子邮件给我,[email protected]

解决方案 »

  1.   

    txtremosthost.text="\\192.168.5.10"
    txtmessage.text="Hello"
    shell "net send "+TxtRemostHost.text+" "+TxtMessage,vbhide
      

  2.   

    利用NetMessageBufferSend这个API函数
    Private Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (Server As Any, yToName As Byte, yFromName As Any, yMsg As Byte, ByVal lSize As Long) As LongPrivate Function SendMsg(sToUser As String, sFromUser As String, sMessage As String) As Boolean
        
        Dim yToName() As Byte
        Dim yFromName() As Byte
        Dim yMsg() As Byte
        Dim l As Long
        
        yToName = sToUser & vbNullChar
        yFromName = sFromUser & vbNullChar
        yMsg = sMessage & vbNullChar    If NetMessageBufferSend(ByVal 0&, yToName(0), yFromName(0), yMsg(0), UBound(yMsg)) = NERR_Success Then
        SendMsg = True
        End If
    End Function
    '具体实现部分
      X = SendMsg(adress, SentFrom, TxtMsg.Text)
    通过修改SentFrom可以改变发送者
      

  3.   

    现在用NetMessageBufferSend有些问题,以前还行
      

  4.   

    我曾经看过一本书,上面说VBS可以在控制台上接受数据,就像C一样。但是需要使用一个对象,只可西那本书不是我的。
      

  5.   

    个人感觉用api发比用shell好,可以得到发送成功与否的返回值。