This source code sample demonstrates how you can create a very, very, basic web server. It is not intended for you to actually use but instead to just wet your appetite with a simple networking example. Before someone leaves a nasty comment read this: I am in no way calling this a true web server - just a simple fun example.
What you will end up with after using this very simple code snippet is a little server running in VB that when a web browser hits it will return out whatever text you have set up. I know when I first started playing with networking development it seemed kind of like magic. You can very quickly begin to understand how web servers, a virtual private server, chat programs, email programs, etc. work.
To use this code example do the following: Create a new VB program. Next place a command button on your form named command1 and set the caption to Start Server, you will also need to place the Winsock control on the form. Set its name to Winser. If you don't know how to put a winsock control on your form check out this Client server tutorial to see how. Lastly place the code below into the source code area for your form.
Once you have the code in place press F5 to run your program. Then pull open a web browser and navigate to http://localhost - This will connect to your VB web server and you should see "Wow my first webserver test" show up in your browser.
Obviously this just barely scratches the surface as to what we can do with the winsock control. You can write virtually any networking application you can think of. If you would like to go more in depth with writing client server or other networking programs check out the links below.
Note: The source for this was found at DreamVB which is no longer online.