Archived articles

Archive for March 2018

Getting GIF image information using C#
Extracting GIF image data in .NET using C#
 
0
GIF image format is most commonly used format for online advertising, especially since all browser starting from major onces stopped supporting Flash animations because of their infamous security vulnerabilities and issues. After going through different articles I found online, I came up with the class which exposes following GIF image properties. ...read more
How to avoid Thread.Sleep in your production code in .NET
Avoiding Thread.Sleep in production code in .NET using C#
0
I am pretty sure any of us used Thread.Sleep method to pause the current thread execution. Mostly this is used to simulate long running process during the test or debug. While this is fine to use for testing, if your intention is to actually schedule thread execution this is probably wrong way of doing it, simply because Thread.Sleep does not actually take as many milliseconds as you pass to the method as a parameter...read more
Reduce traffic by serializing JSON with different alias with Json.NET and C#
Reducing speed and increasing performance by reducing traffic with JSON size
0
One of the reasons JSON is used rather than XML is it's simplicity in notation. However XML is claimed to be more human readable than JSON and JSON is easier to parse for machines, so basically we switched from XML in favor to machine processing. If you take a C# class and serialize it to JSON string you still find it quite readable since we kept all nice property names in the JSON output...read more
log4net logger for Microsoft Azure Log Analytics
Logging to Azure Log Analytics using log4net
 
0
Recently I wrote an article on how to Send data to Azure Log Analytics from C# code which is demonstrating pushing data from your code to Microsoft Azure Log Analytics and simple quering the data from the Log Analytics. Azure Log Analytics are extremely helpful for storing application logs because they provide transformation of the raw data into queriable columns, you can easily query your logs stored in Log Analytics and export to Excel format if you need to share the data or you just want to make some offline data analysis. ...read more
Setting IP address and domain filtering in IIS using PowerShell script
Restricting and allowing traffic to web application through IIS using PowerShell
0
Starting from IIS 7.0 Microsoft introduced IP and Domain restrictions feature as a part of IIS setup. However, if you do not have this feature installed on your IIS you can easily install it through windows features adding steps which are pretty much same for each Windows version (https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/ipsecurity/add) or simply by using WebPlatform Installer. Just run WebPlatform Installer and search for IP and Domain restrictions in search box...read more
Download file in chunks in parallel in C#
Improved file download using chunks of file in parallel in C#
 
0
Downloading large files from your code may cause problems due to limitations in your network or system where your code is executing. For example, some systems limit the size of the file you can download through the network...read more
Displaying multiple select input for Enum in Swagger WebApi UI
Multiple select input Swagger WebApi UI
 
0
Enums in C# can contain multiple values if they are decorated with [Flags] attribute. However, Flag Enums are not recommended to be used in web api action method signatures...read more
Handling Cross-Site Scripting (XSS) in ASP.NET MVC
Handling XSS in ASP.NET MVC with custom Razor Html helpers and HttpModule
 
0
Cross-site Scripting (XSS) refers to client-site code injection attack where an attacker can execute malicious scripts into a web application. Basically attacker manages to upload malicious script code to the website which will be later on served to the users and executed in their browser. It is ofter use to steal form inputs, cookie values, change the page layout or redirect to attackers website. ...read more
Using WebP Images in APS.NET with a fallback to JPEG and PNG
WebP images in ASP.NET with fallback for browsers not supporting WebP
 
0
WebP is an image format introduced by Google Developers and it provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster. ...read more
Converting existing website images to Google WebP using PowerShell
Encoding existing image files to Google WebP format
 
0
WebP is an image format introduced by Google in 2010. It uses specific technique to compress image and reduce size significantly while not changing the image quality on the larger scale...read more

.NET

read more

JavaScript

read more

SQL/T-SQL

read more

Umbraco CMS

read more