I have got this error message : Object of type 'System.String' cannot be converted to type 'System.String[]'
The part of the source code that gives me the error:
But it comes up with this error message: Object of type 'System.String' cannot be converted to type 'System.String[]'
Im kinda new to .net, threads and sockets and i have gone thru the code several times without finding any solution.
If anyone have a clue about what i have done wrong or can explain the error message to me i would appreciate it.
The part of the source code that gives me the error:
VB.NET:
Private Sub DoRead2(ByVal ar As IAsyncResult)
Dim allIn(1) As String
Dim BytesRead As Integer
Dim strMessage As String
Dim strAddress As String
Dim who As IPEndPoint = TCP2.Client.RemoteEndPoint
strAddress = who.Address.ToString
BytesRead = TCP2.GetStream.EndRead(ar)
strMessage = Encoding.ASCII.GetString(ReadBuffer, 0, BytesRead)
allIn(0) = strAddress
allIn(1) = strMessage
ProcessCommands(allIn)
TCP2.GetStream.BeginRead(ReadBuffer, 0, ReadBufferSize, _
AddressOf DoRead2, Nothing)
End Sub
Private Sub ProcessCommands(ByVal allIn() As String)
If Me.TextBox1.InvokeRequired Then
Dim d As New PrCommands(AddressOf ProcessCommands)
*******The line below gives me the error *****************
Me.TextBox1.Invoke(d, allIn(0) + "-" + allIn(1))
Else
TextBox1.Text = allIn(0) + "--" + allIn(1)
End If
End Sub
Im kinda new to .net, threads and sockets and i have gone thru the code several times without finding any solution.
If anyone have a clue about what i have done wrong or can explain the error message to me i would appreciate it.