c# - Getting file size in KB -


i storing file in database in kb. try convert file length return file info kb follow.

fileinfo filevol = new fileinfo(downloadpath); int sizeinkb = (int)(filevol).length / 1024 ; 

if file size return db , value in size in kb equal code allow install software downloadpath. getting value in size in kb less of value return db (always 1 kb). wrong me.

please resolve.

fileinfo filevol = new fileinfo(downloadpath); string filelength = filevol.length.tostring(); string length = string.empty; if (filevol.length >= (1 << 10))   length= string.format("{0}kb", filevol.length >> 10); 

length=> result kb of file.


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -