• Sábado 27 de Abril de 2024, 04:58

Autor Tema:  Winsock  (Leído 2066 veces)

jhonathan2006

  • Miembro activo
  • **
  • Mensajes: 28
    • Ver Perfil
Winsock
« en: Martes 5 de Diciembre de 2006, 15:15 »
0
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

RadicalEd

  • Moderador
  • ******
  • Mensajes: 2430
  • Nacionalidad: co
    • Ver Perfil
Re: Winsock
« Respuesta #1 en: Martes 5 de Diciembre de 2006, 18:06 »
0
Buscando se encuentra Winsock VB
El pasado son solo recuerdos, el futuro son solo sueños

seether

  • Miembro activo
  • **
  • Mensajes: 52
  • Nacionalidad: cl
    • Ver Perfil
Re: Winsock
« Respuesta #2 en: Domingo 17 de Diciembre de 2006, 02:46 »
0
hey RadicalEd que imagen es esa, esta buenisima. :P

sysmcn

  • Nuevo Miembro
  • *
  • Mensajes: 18
    • Ver Perfil
Re: Winsock
« Respuesta #3 en: Viernes 23 de Marzo de 2007, 21:43 »
0
Mira el archivo que te adjunto , tiene varias urls interesantes
El mensaje contiene 1 archivo adjunto. Debes ingresar o registrarte para poder verlo y descargarlo.

Nuker

  • Nuevo Miembro
  • *
  • Mensajes: 7
    • Ver Perfil
Re: Winsock
« Respuesta #4 en: Domingo 1 de Abril de 2007, 05:24 »
0
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

CIRANO

  • Nuevo Miembro
  • *
  • Mensajes: 4
    • Ver Perfil
Re: Winsock
« Respuesta #5 en: Jueves 24 de Mayo de 2007, 00:01 »
0
HOLA A TODOS BUENO SOY NUEVO EN ESTO DE VB Y QUERIA SABER DONDE LO DESCARGO SII Y COMO SE INSTALA OK
AYUDENME.
El mensaje contiene 1 archivo adjunto. Debes ingresar o registrarte para poder verlo y descargarlo.