Multithreaded File Transfer

pitaridis

Well-known member
Joined
Nov 18, 2005
Messages
63
Programming Experience
10+
I develop an application which will allow a user to create multiple choice tests. It is a client / server application. On the server I will be able to create tests and save them to file(s). The client will connect to the server and get the files for the test. Can someone help me with the file transfer code? I want the client to ask for a files list and after that the client will ask one file every time until all the files have been stored to the local drive of the client’s pc.
 
WebClient class (in System.Net) can be used with it's DownloadFileAsync method.
 
It is going to be windows application. I want a sockets example in order to transefer the files
 
It's two lines of code to create a new webclient and call the DownloadFileAsync method. How hard can it be?
VB.NET:
dim ohmy as new net.webclient
ohmy.DownloadFileAsync("address", "filename")
 
This is the code for downloading the file but what the code to uload the file? I want a server to serve the files and the tests and a client to get the tests and the required files in order to start the test.
 
Try the TcpClient and TcpServer classes (in System.Net.Sockets), they are very easy to get started with and there is plenty of beginner sample code for them on the web too. There is a Net/Sockets forum on this site also.
 
Back
Top