tags:

views:

46

answers:

1

how can i send multiple files over TCP with C#, all the samples on the internet sends only a sinle file, im looking for something like this, loop through files in a folder and sending over tcp, this is the client, server side i want to receive and save them to disk,

A: 

Have the client call and get all the files in the directory; Use a DirectoryInfo object to get a list of the files in the directory, and return it; Then have the client ask for the files one by one.

Jess
this is exactely what im doing, i get only the first file, take a look at my other post, it has my code in ithttp://stackoverflow.com/questions/3625463/send-multiple-file-over-tcp-with-c-using-tcpclient
xnoor
thank you Jess for the hint,,ok, i think i know what i was doing wrong, on the server, i was sending all the file at once, looping thorugh the file in the directory and writing them to the stream one after the other, the client was getting confused where is the start and end of the files, so i should do is,first the client ask for an update from the server, then the server sends list of the files to be updated, then the client starts downloading them one by one.
xnoor