Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 00:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



vb6 winsock tutorial

Discussion on vb6 winsock tutorial within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2005
Posts: 4,620
Received Thanks: 104
Ich weiß, vb6 ist aaaaaaaalllt und 2005 ist sooooo besser (kann ich auch gleich zu C# gehen), aber fürs erste will ich das noch probieren. Okay, ich suche ein Winsock tutorial was allerdings direkt HEX packets schickt/verarbeitet und nicht im ASCII format, ich hab zwar ein paar Beispiel sources, allerdings versteh ich nicht so recht wie ich das machen soll. Also ne TCP verbindung.
Maybe It's Maybelline is offline  
Old 08/15/2006, 21:50   #2
 
elite*gold: 0
Join Date: May 2005
Posts: 2,922
Received Thanks: 106
Erstmal packst du das Winsock Control auf deine Form.
Wie das geht weisst du ja denk ich mal.

Nun gehts an den Code.
Wenn dies ein Clientsocket werden soll solltest du am besten zu etwas connecten.

Je nachdem wo du's haben willst kommt dann das hin :

Code:
Winsock1.Connect "127.0.0.1", 50001

Nun versucht er eine Verbindung aufzubauen.
Fals die klappt wird das WinsockEvent Connect aufgerufen.
Wie du das zum Code hinzufügst weisst du sicher.
Fals nicht : Du klickst in der Codeansicht oben direkt über dem Codefenster auf die linke Listbox und wählst das Winsock Control aus. In der Rechten kannst du nun zu den Events springen die das Winsock Control mit sich führt.
Fals diese noch nicht im Code vorhanden sind werden sie sofort hinzugefügt.

So nun wurde connected.
Nun wartest du auf Daten die ankommen.
Sobald Daten ankommen wird das WinsockEvent DataArrival aufgerufen.
Wie du die Daten abfängst siehst du hier.

Code:
Dim incData as String 'je nachdem was man will

Winsock1.GetData incData
Nun hast du daten erhalten. ;o

Fals du welche versenden willst nutzt du folgendes.

Code:
Dim Packet as String

Packet = "HALLO"

Winsock1.SendData Packet
oder als Byte Variante

Code:
Dim Packet(4) as Byte 'HALLO = 5; 0 bis 4 = 5;D

Packet(0) = &H48
Packet(1) = &H41
Packet(2) = &H4C
Packet(3) = &H4C
Packet(4) = &H4F

Winsock1.SendData Packet
CyRuSTheViRuS is offline  
Old 10/24/2006, 18:51   #3
 
elite*gold: 0
Join Date: Jul 2005
Posts: 61
Received Thanks: 1
Server:
Code:
Private Sub ServerButton_Click()
  Winsock.LocalPort = 2415
  Winsock.Listen
End Sub

Private Sub Winsock_DataArrival()
  Dim Data As Variant
  Winsock.GetData Data
  TextBox.Text = Data
End Sub

Private Sub CloseButton_Click()
  Winsock.Close
End Sub
Client:
Code:
Private Sub ClientButton_Click()
  Winsock.RemoteHost = 127.0.0.1
  Winsock.RemotePort = 2415
  Winsock.Connect
End Sub

Private Sub SendButton_Click()
  Winsock.SendData TextBox.Text
End Sub

Private Sub CloseButton_Click()
  Winsock.Close
End Sub
Du kannst auch noch Connection Probleme abfangen mit Winsock_Error(), und vieles mehr ^^'

Tut mir Leid aber mehr weiß ich nicht, ist schon mehr als ein Jahr her ...
Lutscher is offline  
Reply


Similar Threads Similar Threads
[Advanced] Winsock in C#
05/23/2013 - CO2 Programming - 7 Replies
Requires ws2_32.dll, and "using System.Runtime.InteropServices" // fuck creating my own socketerror enum LOL using SocketError = System.Net.Sockets.SocketError; // Interface to ws2_32.dll public unsafe partial class Native
[C++] Winsock + Select
12/03/2009 - C/C++ - 13 Replies
I solved this Problem adding a "continue;" at if(FD_ISSET(aSocket, &fdSet)) { AddSocket(accept(aSocket, NULL, NULL)); continue; }
[C++] winsock ws_32.dll hook
06/05/2009 - C/C++ - 5 Replies
i am trying to make a hack for a online game. but i don't know how to hook my program to the process name : khanclient.exe can someone help me? this is my current code in VB2008 the point in this is i want to click a button and send a packet to server from client. i hope you get what i mean. here is a screenshot:
Vb6 : A Simple Winsock Connection !
04/12/2009 - .NET Languages - 0 Replies
I made a little tut for a simple winsock connection In visual basic 2006 ! So here it comes Start with opening vb6 http://img412.imageshack.us/img412/9527/54328939. jpg Now open Standard EXE http://img258.imageshack.us/img258/5764/73925545. jpg
winsock in vb.net?
12/29/2007 - Conquer Online 2 - 4 Replies
anyone know how to get winsock into vb.net?ive been googleing for an answer and cant findone. i downloaded oswinsock and still not sure how to use it?? Ive been using vb6 for a while and am using vb 2005 for the first time and this is pissing me off.i read i should use systemcom.net or somthing? just anyone know how i can use winsock in vb.net or explain what i need to do,before i give up on this .net framework and stick with my trusty vb6 if anyone has a simple source proxy in...



All times are GMT +2. The time now is 00:06.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.