Hello Everyone,
I have list items.

This 3 records contain images, that is image path from database. I want to get total size of the image group by ArchievedName .
1st item,
2nd item,
3rd item,
I have tried,
- List
objDocumentUserSetup = new List(); - bjDocumentUserSetup = objUserSetUp1.AsEnumerable().Select(m => new Tble_Documents()
- {
- ArchievedName = m.ArchievedName,
- UpdatedDate = m.UpdatedDate,
- Fullname = m.Fullname,
- FilePath = m.FilePath + m.Parent_File_Name + "_" + m.Child_File_Name,
- docCount = m.docCount,
- FileSize = FormatBytes(new System.IO.FileInfo(m.FilePath + m.Parent_File_Name + "_" + m.Child_File_Name).Length) /*How can do here?*/
- }).ToList();
- private static string FormatBytes(long bytes)
- {
- string[] Suffix = { "B", "KB", "MB", "GB", "TB" };
- int i;
- double dblSByte = bytes;
- for (i = 0; i < Suffix.Length && bytes >= 1024; i++, bytes /= 1024)
- {
- dblSByte = bytes / 1024.0;
- }
- return String.Format("{0:0.##} {1}", dblSByte, Suffix[i]);
- }


Nitin SontakkeRank #264 · 9.6K reputationPosted Jan 1, 2017, 5:34 PM EST
sudipta sanyalRank #1,945 · 753 reputationPosted Jan 1, 2017, 6:49 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Jan 1, 2017, 10:48 PM EST
Abhilash J ARank #1,243 · 1.4K reputationPosted Jan 1, 2017, 8:14 PM EST
Abhilash J ARank #1,243 · 1.4K reputationPosted Jan 1, 2017, 11:03 PM EST