SoloCodigo

Programación General => Visual Basic 6.0 e inferiores => Visual Basic para principiantes => Mensaje iniciado por: jhonathan2006 en Martes 5 de Diciembre de 2006, 15:15

Título: Winsock
Publicado por: jhonathan2006 en Martes 5 de Diciembre de 2006, 15:15
Quiero empezar a trabajar con VB, y me estan solicitando una Aplicacion Winsock, tengo unos manuales que consegui en internet pero son muy basicos y siempre estan repetidos... Alguien me podra facilitar material que este bien detallado
Título: Re: Winsock
Publicado por: RadicalEd en Martes 5 de Diciembre de 2006, 18:06
Buscando se encuentra Winsock VB (http://www.google.com/codesearch?as_q=winsock&btnG=Buscar+c%C3%B3digo&hl=es&as_lang=basic&as_license_restrict=i&as_license=&as_package=&as_filename=&as_case=)
Título: Re: Winsock
Publicado por: seether en Domingo 17 de Diciembre de 2006, 02:46
hey RadicalEd que imagen es esa, esta buenisima. :P
Título: Re: Winsock
Publicado por: sysmcn en Viernes 23 de Marzo de 2007, 21:43
Mira el archivo que te adjunto , tiene varias urls interesantes
Título: Re: Winsock
Publicado por: Nuker en Domingo 1 de Abril de 2007, 05:24
Agrega en un formulario el componente Microsoft Winsock control 6.0

crea un winsock llamado "Winsock1"

agrega un boton (command1) en caption q diga HOSTEAR, mete otro abajo (command2) llamado CONECTARSE alado ponele un textbox llamado text3

pone un timer llamado timer1


mas abajo pone un textbox gigante llamado Text1 y en la opcion Multiline ponele True

mas abajo pone un textbox llamado Text2 y alado un command buton llamado command3


apreta Inicio, panel de control Firewall de windows, Agregar Puerto (TCP) Puerto "77".

espero q te funcione  :P



'CODIGO (Cliente)

Private Sub Command1_Click()
Winsock1.LocalPort = 77
Winsock1.Listen
End Sub

Public Function WinsockSend(pSock As Winsock, ByVal Data As String)
' send the data on the passed winsock
If pSock.State = sckConnected Then
' send the data and return true
pSock.SendData Data
DoEvents
WinsockSend = True
Else
' return false because we're not connected
WinsockSend = False
End If
End Function

Public Function WinsockGet(pSock As Winsock, ByVal Data As String)
' send the data on the passed winsock
If pSock.State = sckConnected Then
' send the data and return true
pSock.GetData Data
DoEvents
WinsockGet = True
If Not Data = vbNullString Then
Text1.Text = Text1.Text & Chr(13) + Chr(10) & Data
End If
Else
' return false because we're not connected
WinsockGet = False
End If
End Function

Private Sub Command3_Click()
blnRetVal = WinsockSend(Winsock1, Text2.Text)
End Sub


Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
blnRetVal = WinsockGet(Winsock1, strData)
End Sub

Private Sub Winsock1_Connect()
MsgBox "Connected"
End Sub

Private Sub Command2_Click()
Winsock1.RemoteHost = Text3.Text
Winsock1.RemotePort = 77
Winsock1.Connect
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)
MsgBox "Error: " & Description
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal RequestID As Long)
Winsock1.Close
Winsock1.Accept RequestID
End Sub
Título: Re: Winsock
Publicado por: CIRANO en Jueves 24 de Mayo de 2007, 00:01
HOLA A TODOS BUENO SOY NUEVO EN ESTO DE VB Y QUERIA SABER DONDE LO DESCARGO SII Y COMO SE INSTALA OK
AYUDENME.