I can send a packet with this:
Public Class Form1
Dim publisher As New Sockets.UdpClient(0)
Dim subscriber As New Sockets.UdpClient(2000)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
publisher.Connect(TBTo.Text, TBPort.Text)
Dim sendbytes() As Byte = ASCII.GetBytes("test")
publisher.Send(sendbytes, sendbytes.Length)
End Sub
End Class
It works great and using WireShark I can see on Port 9 a UDP Packet being sent to my IP (which I type into the address/word box).
I understand for WOL (Which I DO have working, just want to make my own application for fun/experience) you need a MAC, will it just "adding a MAC" address to this make it a WOL packet or is it more complicated than that?
NOTE: I can see the difference in WOL and UDP packets in Wireshark and changing my IP to "MYIP". For example below is a WOL packet sent from a WOL application.
40.000203000 MYIP 192.168.1.1 WOL 144 MagicPacket for Micro-St_21:94:b6 (44:8a:5b:21:94:b6)
Compared to a normal UDP packet:
69 12170.303276000 192.168.1.1 MYIP UDP 46 Source port: 57465 Destination port: 9
EDIT: I have played about A LOT with some examples but they are not the best.