Posted 29 October 2012 - 17:51
Your code doesn't compile. It's not valid Visual Basic and Visual Studio should show you some error messages in its output and error windows when you attempt to start the program. These error messages can often tell you what the problems are and how to fix them.
- The Imports directives should go at the top of the file, not inside a class declaration
- Your MyTcpListener class is declared inside the Form1 class, which is illegal - move it after the "End Class" of Form1 or, better, to its own file
- You're declaring a Main() function inside MyTcpListener, but your project is probably a Windows Forms Application, which already has its own Main() function - a .NET program must have only one Main() function.
- The code that goes inside that Main() method should go in the OnLoad() method of the Form1 class, as I explained to you before
Do you even know what is a class, a module, a namespace, what do access modifiers do, how to override a virtual method, what are events, how to register/unregister to them, what's a Shared method vs non-Shared, what is the purpose of the Main() method, etc? Implementing multiplayer will require putting together several pieces which you seem to ignore the very nature of. It's not like you're going to copy-paste the correct code here and there and it's all magically going to work; even if it did, that wouldn't be very useful to you, would it? Start by properly learning Visual Basic and the .NET Base Class Library and then you'll be able to implement advanced functionality like this and understand what you're doing. Learn to walk before you run...