Latest posts

  • C# EventHandler with Arguments

    All the methods that are called by events require two arguments: object sender EventArgs e The event calls a method using those 2 parameters, so we can’t directly add a custom argument. If we have this code and we want...


  • C# Load dll at Runtime

    This is a method used to import a dll during the program’s execution (at the runtime) without adding the actual library as a reference. Obviously, you will need: A DLL made in C# - only a function and a class...


  • C# Send email using Gmail

    In this tutorial … we’ll send emails :) using C# of course. 1. Required: SMTP server I use: smtp.google.com , you must have a Gmail account Little attention / some basic knowledge of C# 2. Creating the client We start...


  • C# Countdown Timer

    A timer in C # is an object that executes an action after a specified time interval - for example, it can call a method every 5 seconds. The best way to understand how it works is to use it...


  • C# String vs StringBuilder

    StringBuilder or String? Is there any difference? It is - and not only the name, when we talk about our program’s performance. I’ll start by explaining how each one works so you’ll understand why this and not that. String 1...


  • C# Moving form without border/title bar

    1. Removing the title bar and border In this tutorial I will show you how you can make a window (Form) with no title bar or border - which we can also move with the cursor. I assume you already...


  • XNA Disable Profile check

    HiDef is one of the 2 profiles available for developing games in XNA. But…this profile requires a direct3d/D3D compatible video card. It apparently checks for DirectX10 compatibility. XNA will check this before compiling/running the project and will throw an error...


  • C# Text to Speech

    Windows SAPI is a nice tool that comes with Windows that allows us to transform an input text into a speech. Ok, this is quite simple…takes only 3 lines of code, so not much explanation is needed. How to? Right...


  • C# Form with Gradient Background

    Gradient is a method which consists in slowly switching from one color to another - it’s used very often in application’s design. In this tutorial I’ll show you how to create this effect using only code: First, create a Forms...


  • C# Connect to MySql

    MsSql or MySql ? What to use ? I prefer MySql because I work with it more often. Unfortunately .NET doesn’t support by default this kind of database… There’s a solution! It’s a small library called Connector/NET, available on MySql’s...


  • C# Working with Xml Documents

    XML is the main file type used to save our program’s data. In this tutorial, I’ll show you how to work with XML files in C#. I’ll be working with the following file: 1 2 3 4 5 6 7...


  • C# Simple Tcp Server

    If you got here, you probably want to know how to make a simple server in C#, using the shortest possible code and the easiest method to understand. For the sake of simplicity we’ll make a synchronous server using a...