Note: The code found here and anywhere else on this site are free to use and learn from. However under no circumstances are these projects or samples to be posted, distributed, or sold, without written permission from xi0n.com or the author.
  


  

Submissions  By
  Code Timer (VB6) Danny
  File Viewer Example (VB6) Violent
  Holobot Source (VB6)

Inty

  ListView Example (.NET)

Inty

  Splitting/Combining Winsock Data (VB6) Danny
  TCP- IP Client/Server Example (VB6) Violent
  TreeView Example (.NET) Violent
  VP Filter Starter (VB6) Danny
  Web Client Example (C#) 

Inty

  Yahoo Socket & Source (VB6)

Inty

  

 VP Filter Starter

Language

Posted By

Visual Basic 6.0

Danny

 

Older project that gives you a head start on where to trap packets and edit them. It then changes the sec bytes and length bytes accordingly. (Adapted from the VP Packet Viewer Project)

 

Click here to download source

 

 Code Timer

Language

Posted By

Visual Basic 6.0

Danny

 

Simple project that uses GetTickCount API to time how long it takes to run a line or a whole routine x times. Displays result (milliseconds) in message box.

 

Click here to download source

 

 Holobot Source

Language

Posted By

Visual Basic 6.0

Inty

 

Ok...someone kept bugging me for the holobot source, so here's the older vb6 version. It's sloppy, but this is what I made the yahoo socket from, so its pretty much the source to yahsock as well. 

Has some simple AI and a few good web services (Google, translator , stock market etc.)

 

Click here to download source

 

 WebClient Example

Language

Posted By

C#

Inty

 

Here's a little example of the System.Net.WebClient Class.

This example features the use of invoking delegates to make asynchronous methods (before I added the delegate invoking, the form would 'freeze' until the webclient had finished its task)

How to use the StringBuilder class ... the fastest way to assemble strings in .net (.net has inbuilt unicode and ascii encoding which is ok for basic text but anything that uses extended ascii or the full byte range needs a method just like I put in this one.)

And also shows control anchors in action (you set them in the controls properties and it tells the controls how to resize when the forms resized)

 

Click here to download source

 

 TreeView Example

Language

Posted By

VB.NET

Violent

 

This was my first .NET application. I just wanted to see how the TreeView controls works. So here it is. I'm sure its not the best example, but its good for the beginners.

 

Click here to download source

 

 ListView Example

Language

Posted By

VB.NET

Inty

 

I needed to do something in list view in vb.net so here's some example source I ended up with. Doesn't use all of ListView's talents but enough to get on the right track.

 

Click here to download source

 

 Yahoo Socket & Source Example

Language

Posted By

Visual Basic 6.0

Inty

 

For you Yahoo fans... this is an ActiveX control (YahSock) and an example source code showing how to use its basic functions. 

Uses the YCHT protocol...

 

Click here to download source

 

 TCP- IP Client/Server Example

Language

Posted By

Visual Basic 6.0

Violent

 

This is downloadable source for both a client and a server applications that connects through IP and sends simple text strings to each other.

Its a good start if your new to winsock and want to get the hang of it before you attack a huge networking project. 

 

Click here to download source

 

 File Viewer -  Example

Language

Posted By

Visual Basic 6.0

Violent

 

This is downloadable source that shows how to use a RichTextBox and a CommonDialog control together to open pictures (Gif, Jpg, Bmp) and documents of either richtext or regular text format...

 

Click here to download source

 

Splitting/Combining Winsock Data Language Coded By
Visual Basic 6.0 Danny (sup)
 
As most all of you know, VPlaces larger packets are usually split up into 'chunks'. This is a pain for any server/client/bot because you cant do anything with the data until its complete. 

Now I used to have an OCX that I made for this but through time I came up with this. This code is the smallest, most practical, and memory efficient way I have been able to come up with. Well...almost. The absolute best way means processing the end data as a byte array. But most of you are used to the String method so I did all the length calculations using a byte array and API, then when its all set, grabs it as a string and sends it through.

Note: This code sends the final string to your function ('ProcessData()' in this example) with the counter byte and the length bytes removed. You can easily change it though to include those as well if your app is already dependent on having those in the string.


'//////////////////////////////////////////////
'// API Declarations
'//////////////////////////////////////////////

Declare Sub CopyMemory Lib "kernel32" Alias  _
   "RtlMoveMemory" (pDest
As Any, pSource As Any,  _
   
ByVal ByteLen As Long)

Declare Function ntohl Lib "wsock32.dll"  _
    (ByVal a
As Long) As Long

'//////////////////////////////////////////////
'// Winsock Data Arrival Event
'//////////////////////////////////////////////

Dim bData() As Byte
Dim strData As String
Dim lngLength As Long

Split:

'dont remove data from winsock, just look at it
wskClient.PeekData bData(), vbArray + vbByte
'get length
CopyMemory lngLength, bData(1), 4
'convert length from big-end to little-end
lngLength = ntohl(lngLength)

'if theres a full string in there
If wskClient.BytesReceived >= lngLength + 5 Then

   
'grab string
    wskClient.GetData strData, vbString, lngLength + 5

   
'remove counter and length bytes, then send through
   
Call ProcessData(Mid$(strData, 6, Len(strData) - 5))

   
'see if there's more in holding
   
If wskClient.BytesReceived > 4 Then GoTo Split

End If