I don't understand the error.
This is the code for a LAN chat client. I found the base on the web, and am adding things such as usernames.
Imports System.IO
Imports System.Net.Sockets
Module Module1
Sub Main()
Try
Console.WriteLine("Type your nickname")
Dim serverListener As New TcpClient("localhost", 8585)
Dim readStream As Stream = serverListener.GetStream
serverListener.SendBufferSize = 256
Console.WriteLine("Input Lines:")
Dim str As String = Console.ReadLine(2) + Console.ReadLine()
While True
Dim sendBuff As Byte() = System.Text.Encoding.ASCII.GetBytes(str)
readStream.Write(sendBuff, 0, sendBuff.Length)
If str.StartsWith(".") Then
GoTo Done
End If
str = Console.ReadLine()
End While
Done: Console.WriteLine("Done")
Catch exp As Exception
Console.WriteLine("Exception: " + exp.ToString())
End Try
End Sub
End ModuleI get an error that says:
Error 1 'Sub Main' was not found in 'ConsoleApplication1.Module1'. simplechatclient
This project does not have a valid Sub Main(). You must add
Sub Main()
End Sub
to a module.
Yet in the code, I have sub main and end sub. Any help?
Offline
Works fine for me. Just copy the code to a new project.
My site Offline
Try re-running it. Just press F5.
Sometimes this happens to me. There's a problem with the error finder.
Offline