Hello, all. This is my first post in here. I am currently learning how to program in VB and am using sample code to make a VB Winsock client and server. I beleive the sample code was from VB 6.0.
I am getting an error with it though. Here is the code for the client:
Code:
Imports MSWinsockLib
Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Public Class Form1
Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
sockMain.RemoteHost = txtHost.Text
sockMain.RemotePort = txtPort.Text
sockMain.Connect()
End Sub
Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
sockMain.SendData(txtSend.Text)
End Sub
Private Sub winsck_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
sockMain.GetData(strData, vbString) ' <----ERROR HERE!!!!!!
txtStatus.Text = txtStatus.Text & _
strData & vbCrLf
End Sub
End Class
Error:
Overload resolution failed because no accessible 'GetData' accepts this number of arguments.
I am getting the exact same error in the exact same place in the server aswell. I have tried removing the vbString, but it comes up with a warning and the program doesn't function like it should.
I am programming this in Visual Basic 2010 Express. Any help is appreciated! Thansk!
Cory