Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all!
I use TCP Listener/TCP client to connect between PC and PPC. I also send message from client(PPC) to server(PC). And now I hope see folder list/file list of PC from PPC. Where can I begin? Can I use DirectoryInfo to get folder name and file name, then I send to client?
Need your helps
Thank you very much
Posted

1 solution

First, about getting files/directories in directory: there is one problem you should be aware of. See this discussion: Directory.Get.Files search pattern problem[^]. You will find a solution as well. This is all about information on file structure on your server.

Find some useful ideas about networking application design:
Multple clients from same port Number[^],
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].
Sorry, some models of networking I mentioned are not relevant to your case. In you case I advice you stick to your level of choice: TcpListener/TcpClient level. Classical remoting or WCF (self-hosted) also can be considered.

From the above references you will see that one of the keys to successful networking design is threading. This is a useful collection of my references to my past Answers on the topic:
How to get a keydown event to operate on a different thread in vb.net[^];
This is a very useful thread wrapper:
How to pass ref parameter to the thread[^].

—SA
 
Share this answer
 
v2
Comments
JF2015 19-Apr-11 1:53am    
Good one. Detailed and correct. 5+
Sergey Alexandrovich Kryukov 19-Apr-11 2:03am    
Thank you very much.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900