The Nemisis Guide to Hacking Article Two - Connecting, Sending, and Reciving Data Via Winsock Level - Beg/Inter By Nemisis (sbbutts@attbi.com/www.NemisisCommunications.com) This document is soley for educational purposes. I take no responsibility for anything you do, or say, after reading it. In other words; Do not try this at home...(or anywhere else). This is a small tutorial to get you started on winsock. It is not meant to teach you everything, it is just meant to give you a general idea of how it works. I use VB 6, so all the code in here works best with that. But should work on other versions of VB also. As I write this tutorial, I am assuming that you have some experince with VB so, I don't go into much depth about certian things. If you dont have a basic knowladge of how VB works, and the language, I suggest you search for some more basic tutorials on the web, before reading this one. Step One - Before you can starting using winsock, you have to put a winsock control on your form. This is done by right clicking on the toolbar and going to components. Once in components you scroll down and check the item called Microsoft Winsock Control. Click ok, and it should appear on your tool bar. Click on the winsock control and place one on your form. Step Two - Now for the purposes of this tutorial, you should also put a Command Button, and 3 Text Boxes on the form. Open up the code window for the Command Button by double clicking on it. Add this code to it. ------------------ winsock1.connect text1, text2 'this makes the winsock connect to whatever text1 is, on whatever port you set text2 to be. ------------------ Now, You should have a winsock control on your form. Double Click on the winsock control to open up the code menu. The default area is Winsock1 Error, and the code looks like this... ------------------ Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) End Sub ------------------ This means nothing to you at this point. Look in the top right corner of the code menu where there is a drop down box, the item there says 'Error'. Click there so the drop down menu shows the rest of its contents and select 'Connect'. This is the area of code where you will send data after the connection is made. What you want to put here is something like this. ------------------ msgbox "Connection Made" winsock1.senddata "This is the data to be sent" ------------------ Go back to the top right corner of the code menu where there is the drop down box, the item there says 'Connect'. Click there so the drop down menu shows the rest of its contents and select 'Data Arival'. This is the part of the code that handles what happens when you recieve data from the winsock connection. You could put something like this there. ------------------ dim data as string winsock1.getdata data text1.text = data msgbox "Data Arival" ------------------ This was just a general explaination of what you can do with winsock. I have no idea what you want to be connecting too, what data you want to send, what you want to recieve, and what you want to do with the data when you get it. If you don't know the answers to these questions as well, then you should learn a bit more VB before trying to tackle winsock. -Nemisis