Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winsock and writing to a file.

Status
Not open for further replies.

g8orade

Technical User
Joined
Aug 24, 2000
Messages
92
Location
US
Hi,
I am new to vb and was looking at the tutorials using winsock. I am trying to create a listener program that will listen on a port and then save the data to a file. I am not sure how to save the data stream to a file. Thanks in advance.
G8orad
 
How about something like...

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String

Winsock1.GetData strData

Open MyFile.txt for append as #1
Print #1, strData
Close #1

Winsock1.Close
End Sub

Alan

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top