Website development and design blog, tutorials and inspiration

C#

C# Tutorials for people who wish to learn the Microsoft .Net Framework and C# language. We take you from the basic programming concepts all the way through to advanced object orientation techniques, scalable solutions and multi-tier applications.

 

Converting To and From Unix Timestamps
7th May 2010C#
From time to time it is necessary to convert to and from Unix timestamps, mainly when dealing with system interoperability. These timestamps are an accurate measure of time from a given point and have a simple data type.
Sending Email via SMTP and C#
16th March 2010C#
There are a million and one reasons why you would need to send an email from within C# code - from sending an order confirmation through to error reporting. In this tutorial we will look at constructing an email message, adding attachments and sending email using the SMTP protocol.
Get Week Commencing from DateTime in C#
4th March 2010C#
This snippet will calculate the date of the start of the week from a given DateTime and return a DateTime containing the week commencing date.
Replace First or Last Occurrence of a String with C#
5th February 2010C#
This snippet provides two functions to replace only the first or the last occurrence of a string within a larger string. Using the Replace method will replace all occurrences found.
Get String In Between Two Others with C#
5th February 2010C#
This useful code snippet will parse a string and return the contents between two tokens. This was originally used as a quick and dirty way to get the contents of an XML string, however it has found many other uses since.
ASP.Net Disable Buttons during AJAX Postback
5th February 2010C#
It is an often overlooked requirement to disable controls on postback during an AJAX postback event to prevent repetitive clicking, a minor problem which can become more serious depending on the action being taken. Payment processing, for example, can result in multiple payments or orders if not handled correctly.
Reading and Writing INI Files with C#
1st February 2010C#
This short snippet is another tool in my utility class. You can use it to quickly read and write settings from an old school INI configuration file. Yes I still use INI files!
Querying iSeries DB2 with ADO.Net
29th January 2010C#
In this tutorial, I will show you how to connect ADO.Net to an IBM DB2 server such as a system I, iSeries or AS400. We will also look at using parameters to create secure query strings.