C# Extension method: Searching lines containing specific string

Searching for lines in text file containing a specific string can be very handy with below code snippet. This method is very optimal specially if we are accessing log/error/access files.


The method can be further improvised to search lines in text files with in a directory containing the specific string.

Resize Image – Programmatically

Thinking of resizing an image programmatically? Pretty simple straight forward. Once done, the process can be use to resize images in bulk without any human intervention & third party software. Below is the C# implementation to do the same:

This implementation can be further improvise to generate various device specific renditions for an image. …

StreamHandler Read Bytes

Getting bytes from a stream or file is quite a normal scenario & once you are able to retrieve the bytes, it can be saved in database as BLOB content as well. This is very handy way of storing any file type (text, audio, video, pdf, etc.) and then play around. Below is C# implementation …