远程开机VB代码,能改为vbs代码吗 | Dim strIP As String = "192.168.1.1" | | Dim strMAC As String = "00-00-00-00-00-00" | | | | | | Dim intCounter As Integer = 0 | | Dim sendBytes(0 To 101) As Byte | | | | | | For I = 1 To 6 | | sendBytes(intCounter) = &HFF | | intCounter += 1 | | Next | | | | For I = 1 To 16 | | | | For J = 0 To 5 | | | | sendBytes(intCounter) = Byte.Parse(strMAC.Substring(J * 3, 2), Globalization.NumberStyles.HexNumber) | | intCounter += 1 | | Next | | Next | | | | | | Dim RemotePort As Integer = 2304 | | | | | | Dim BCIP As System.Net.IPAddress | | Dim EP As System.Net.IPEndPoint | | Dim UDP As New System.Net.Sockets.UdpClient | | | | | | BCIP = System.Net.IPAddress.Parse("255.255.255.255") | | EP = New System.Net.IPEndPoint(BCIP, RemotePort) | | | | UDP.Send(sendBytes, sendBytes.Length, EP) | | | | | | BCIP = System.Net.IPAddress.Parse(strIP) | | EP = New System.Net.IPEndPoint(BCIP, RemotePort) | | | | UDP.Send(sendBytes, sendBytes.Length, EP) | | | | | | udp.Close()COPY |
|