RE:Encender y apagar pc's en LAN
ESTE CODIGO ES PARA ENCENDER LA PC A TRAVEZ DE LA ATI ENVIANDOLE CODIGO BINARIO A TRAVEZ DEL BIOS, DEBES ACTIVAR REMOTE ON PC EN EL BIOS DE LA PC
SI TIENES POR AHI COMO ENCENDERLO PUES.. MANDAMELO.
ESPERO QUE ESTO TE SIRVA
Dim ret As Integer
Private Type datos
a As String * 2
b As String * 2
c As String * 2
d As String * 2
e As String * 2
f As String * 2
nombre As String * 10
End Type
Dim valores As datos
Private Sub Command1_Click()
Dim buffer() As Byte
Dim numero As Byte
ReDim buffer(101) As Byte
Dim VAR(0 To 6) As String
VAR(0) = "&h" & Text1(0)
VAR(1) = "&h" & Text1(1)
VAR(2) = "&h" & Text1(2)
VAR(3) = "&h" & Text1(3)
VAR(4) = "&h" & Text1(4)
VAR(5) = "&h" & Text1(5)
For numero = 0 To 5
buffer(numero) = &HFF
Next
For numero = 6 To 101 Step 6
buffer(numero) = VAR(0)
buffer(numero + 1) = VAR(1)
buffer(numero + 2) = VAR(2)
buffer(numero + 3) = VAR(3)
buffer(numero + 4) = VAR(4)
buffer(numero + 5) = VAR(5)
Next
Winsock1.RemoteHost = "255.255.255.255"
Winsock1.RemotePort = 54323
Winsock1.SendData buffer
End Sub
Private Sub Command2_Click()
ret = Label1
ret = ret + 1
Open "C:\base.xfg" For Random As #1 Len = Len(valores)
valores.nombre = Text2
valores.a = Text1(0)
valores.b = Text1(1)
valores.c = Text1(2)
valores.d = Text1(3)
valores.e = Text1(4)
valores.f = Text1(5)
List1.AddItem Text2
Put #1, ret, valores
Close #1
Label1 = ret
ret = 0
End Sub
Private Sub Command3_Click()
ret = List1.ListIndex + 1
Open "C:\base.xfg" For Random As #1 Len = Len(valores)
valores.nombre = Text2
valores.a = Text1(0)
valores.b = Text1(1)
valores.c = Text1(2)
valores.d = Text1(3)
valores.e = Text1(4)
valores.f = Text1(5)
Put #1, ret, valores
Close #1
Label1 = ret
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Dim W As Integer
Open "C:\base.xfg" For Random As #1 Len = Len(valores)
Label1 = LOF(1) / 22
For W = 1 To Label1
Get #1, W, valores
List1.AddItem valores.nombre
Next
Close #1
End Sub
Private Sub List1_Click()
ret = List1.ListIndex + 1
Open "C:\base.xfg" For Random As #1 Len = Len(valores)
Get #1, ret, valores
Text1(0) = valores.a
Text1(1) = valores.b
Text1(2) = valores.c
Text1(3) = valores.d
Text1(4) = valores.e
Text1(5) = valores.f
Text2 = valores.nombre
Close #1
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then
Index = Index + 1
If Index > 5 Then
Command1.SetFocus
Else
Text1(Index).SetFocus
End If
End If
End Sub