Check out this code... it encapsulates the NetMessage API so you don't have
to spawn a CommandPrompt to do it. It's actually very very simple:
Imports System.Runtime.InteropServices
Public Class NTAlerter
Private m_sFrom As String = String.Empty
Private m_sBody As String = String.Empty
Private m_sTo As String = String.Empty
Private m_sWhere As String = String.Empty
Private Class Win32
<DllImport("netapi32.dll", CharSet:=CharSet.Unicode)> _
Public Shared Function NetMessageBufferSend(ByVal lpServerName As
String, _
ByVal lpMsgName As String, ByVal lpFromName As String, _
ByVal lpBuf As String, ByVal lnBufLen As Long) As Int32
End Function
End Class
Public Property From() As String
Get
Return m_sFrom
End Get
Set(ByVal Value As String)
m_sFrom = Value
End Set
End Property
Public Property Body() As String
Get
Return m_sBody
End Get
Set(ByVal Value As String)
m_sBody = Value
End Set
End Property
Public Property [To]() As String
Get
Return m_sTo
End Get
Set(ByVal Value As String)
m_sTo = Value
End Set
End Property
Public Property Where() As String
Get
Return m_sWhere
End Get
Set(ByVal Value As String)
m_sWhere = Value
End Set
End Property
Public Function Send() As Integer
Dim sTo As String
Dim sFrom As String
Dim sWhere As String
Dim sBody As String
Dim iResult As Integer
If m_sTo = String.Empty Then
sTo = vbNullString
Else
sTo = m_sTo
End If
If m_sFrom = String.Empty Then
sFrom = vbNullString
Else
sFrom = m_sFrom
End If
If m_sWhere = String.Empty Then
sWhere = vbNullString
Else
sWhere = m_sWhere
End If
If m_sBody.Length > 0 And m_sTo.Length > 0 Then
sBody = Left(m_sBody, 255)
iResult = Win32.NetMessageBufferSend(sWhere, sTo, sFrom, sBody,
sBody.Length * 2)
Return iResult
End If
End Function
End Class
"Bob" <bd*****@sgiims.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Thanks, the app is a service that resides on one computer and we don't
want to install anything special on the other computers to keep
maintenance task to a minimum. So I'm leaning towards using the net send
command.
"iwdu15" <jmmgoalsteratyahoodotcom> wrote in message
news:C3**********************************@microsof t.com... you could also use , if your app was on both computers, sockets and
network
streams to send and receive text, then display whatever was received in a
Messagebox
--
-iwdu15