Results 1 to 16 of 16

Thread: Send a wake up packet to UDP port 9 [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    NJ, USA
    Posts
    326

    Resolved Send a wake up packet to UDP port 9 [RESOLVED]

    My PC's ethernet card supports wake on LAN, and I want to write a small VB app to wake up my PC remotely so I can connect to the VNC server I have running on it. I don't like to leave my computer on all the time.

    How would I go about doing this? DSLReports.com has a web based tool that will do it, but I want it coded into my program for simplicity.

    I should mention that the PC is not within the same subnet and so I need to send the code over the Internet. I found some really short code that will send the wake up over a subnet using Winsock, and if I can adapt the Winsock control to send it to a specific IP address, that would be brilliant.


    VB Code:
    1. 'in a form with a command button and textbox
    2. Private Sub Command1_Click()
    3. Dim data As String
    4. data = "FFFFFFFFFFFF"
    5. For i = 1 To 16
    6. data = data & Text1.Text
    7. Next i
    8. data = data + hex2ascii(data)
    9. Winsock1.SendData (data)
    10. End Sub
    11.  
    12. Public Function hex2ascii(ByVal hextext As String) As String
    13. For Y = 1 To Len(hextext)
    14.     num = Mid(hextext, Y, 2)
    15.     Value = Value & Chr(Val("&h" & num))
    16.     Y = Y + 1
    17. Next Y
    18.  
    19. hex2ascii = Value
    20. End Function
    Last edited by Chris H; Apr 24th, 2005 at 05:40 PM.
    VB.NET 2005 Express with .Net 2.0
    C# 2010 .Net 4.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width