Skip to main content

Export Data To Excel File In ASP.NET Using EPPlus

We are going to use EPPLus library in this article. It is an open source library and very easy to use for developers. EPPlus supports many properties like cell ranges, cell styling (border, color, fill, font, number, alignments), charts, pictures, shapes, comments, tables, protection, encryption, pivot tables, data validation, conditional formatting, formula calculation etc. We […]

Read More

Get Base64 String From Image In C#

Below is the code to convert an image into the base64 string in C#. Syntax static void Main(string[] args) { string imagePath=@”E:\images\sample.png”; string imgBase64String = GetBase64StringForImage(imagePath); Console.WriteLine(imgBase64String); } protected static string GetBase64StringForImage(string imgPath) { byte[] imageBytes = System.IO.File.ReadAllBytes(imgPath); string base64String = Convert.ToBase64String(imageBytes); return base64String; }   Example  

Read More