.NET - 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

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

JavaScript

read more

SQL/T-SQL

read more

Umbraco CMS

read more

PowerShell

read more