Fastest way to read dimensions from a picture / image file in C#

The fastest way to read the dimensions (width and height) from a picture / image file in C#, that I know of is: DateTime startDateTime = DateTime.Now; string sourceFolder = @"C:\Temp"; // Get all files from sourcefolder, including subfolders. string[] sourceFiles = Directory.GetFiles(sourceFolder, "*", SearchOption.AllDirectories); foreach (string file in sourceFiles) …

MVC tip: use Url.Content in script src attribute, in *.cshtml files!

In your "*.cshtml" pages, use Url.Content and don’t directly specify the locations of the JavaScript files, because specifying the JavaSript files directly will result in 404 error, when using a virtual directory/application within a IIS website.   So use <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script …

How to create a stored procedure with T-SQL

Well for ages, I created mine stored procedures like: if exists (select 1 from sys.objects where name = ‘GetSales’ and type = ‘p’) begin drop procedure [Reporting].[GetSales] end go create procedure [Reporting].[GetSales] @parameter1 int, @parameter2 int as begin select @parameter1, @parameter2 end go , but there is a slightly shorter …