Get image size in Kb using c#

Posted by Prince | 5:32:00 PM | | 0 comments »


Get image size in Kb in asp.net using c#:
                                                            Use FileInfo and the Length property to measure file size.  Here is the code for  get the file size in your C# program easily.
The blow sample contain code for get image size in KB and MB.
  FileInfo fileInfo = new FileInfo(Server.MapPath("~/Images/Header.jpg"));
            double 
fileSizeKB fileInfo.Length / 1024;
            double 
fileSizeMB fileInfo.Length / (1024 1024);

0 comments

Related Posts Plugin for WordPress, Blogger...