Jump to content
Xtreme .Net Talk

Recommended Posts

  • 2 months later...
Posted
I got this from MSDN. Hope it helps

 

Dim p As New System.Diagnostics.Process()

p.Start("C:\WINNT\system32\net.exe", "send <IPADDRESS> <Message>")

 

So will that work on Windows NT from a remote webserver or will it only work locally. So what i mean is that if this a user goes to a page and then this code is executed then that will only work on the webserver rite?

  • *Experts*
Posted
Here's a basic class to send using the API:
Imports System.Runtime.InteropServices

Public Class NetSend
   'Note the use of the Unicode keyword:
   Declare Unicode Function NetMessageBufferSend Lib "NETAPI32.dll" ( _
       ByVal servername As String, _
       ByVal msgname As String, _
       ByVal fromname As String, _
       ByVal buf As String, _
       ByVal buflen As Int32) As Int32

   Public Shared Sub Send(ByVal destination As String, ByVal message As String)
       NetMessageBufferSend(Nothing, _
           destination, _
           Nothing, _
           message, _
           message.Length * 2) 'times 2 because every one character = 2 bytes in unicode
   End Sub
End Class

Just stick that in a class file and call it like

NetSend.Send("127.0.0.1", "this is a message")

  • 3 months later...
Posted (edited)

Is there anyway to get the

Dim p As New System.Diagnostics.Process()
p.Start("C:\WINNT\system32\net.exe", "send <IPADDRESS> <Message>")

to not close right away?

 

For example you push a key and it closes?

Edited by decrypt
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...