hi
please help me.
I have a question about ports & sockets .
I am trying to write a program that cans listen to the port 80/8080 and deagnose pdf or zip files from other files(html,...). then recive this files from port .
I know how resice the file by c#.net but I do not know how deagnose files type .
thanks.

listen port
ChanKaiShi
If you're reading the file over the TCP (i presume) port then you will have to read the first few bytes to determine the file type.
That is pretty simple: for instance, the every PDF file starts with the byte stream: %PDF-<version number> where <version number is something like 1.3 or 1.5.
Zip files start with the byte stream: PK
Hope this helps.