65.9K
CodeProject is changing. Read more.
Home

Simple Send using Net Send

starIconstarIconstarIconemptyStarIconemptyStarIcon

3.00/5 (8 votes)

May 25, 2004

viewsIcon

116081

downloadIcon

3109

Simple front end for sending text messages over LAN

Introduction

This article shows a basic front-end for Net Send that allows sending messages to multiple recipients.

Using the code

The heart of the whole operation lies below :-

 If lstnames.SelectedItems.Count > 0 Then
   For Each strSeleted As String In lstnames.SelectedItems 
     'somehow a list item is in fact a string
      Dim strname As String = " " & strSeleted
      Dim lngPos As Long = 1
      Do
          Dim lretval As Long = Shell("net send " & strname & _
     " """ & Mid(strMessage, lngPos, iChunk) & """", vbHide)
          lngPos += iChunk
          'pause to stop out of sequence message chunks
          Sleep(100)
      Loop Until lngPos > Len(strMessage)
      strStatus &= strname.ToString
   Next strSeleted
 End If

Points of Interest

Very useful for sending error messages to nearby developers.