Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi guys , I need a client /server code, In which the client will choose the file to send to the server and the server should display only the file characteristics on the screen. In which, file characteristics represent: actual file size and the number of the characters in the file? With C#
Anybody code help me plz ?! I do know how to get file attributes but I wonder how to display only the actual size and the number of the characteristics ?!! Anybody could help ?!!
Posted
Comments
Sergey Alexandrovich Kryukov 24-Feb-15 23:07pm    
What have you tried so far?
Also, in my comment to Solution 1, I explain that "number of characters" part simply makes no sense, in general case.
—SA

1 solution

Start with System.IO.FileInfo, but "the number of the characters in the file" might be difficult without reading it, and how do you know it's not some binary file?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Feb-15 23:10pm    
5ed, but I would advise to formulate "not some binary file" more accurately: there is no such thing as not binary file. It's just not all files consist of "characters", besides, the size occupied by a single character may vary.
—SA
PIEBALDconsult 24-Feb-15 23:54pm    
I know, all files are really "just a bunch of bytes", but that's the point, he'll have to define what is and isn't a "character", and what with UTF8 and such, it ain't easy.
Sergey Alexandrovich Kryukov 25-Feb-15 6:38am    
That's right. I think I explained it.
—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