oafc0000 Posted October 7, 2003 Posted October 7, 2003 Does anybody know how to send a NETSEND broadcast to a PC on your Network using ASP.NET. Regards Michael :-\ :-\ Quote
oafc0000 Posted October 7, 2003 Author Posted October 7, 2003 Sorry found the solution on a different part of the site. Here it is in case your wondering yoursleves Here's a basic class to send using the API: VB: -------------------------------------------------------------------------------- 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 VB: -------------------------------------------------------------------------------- NetSend.Send("127.0.0.1", "this is a message") -------------------------------------------------------------------------------- __________________ ~ Simon "Gravity isn't just a law. It's a good idea!" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.