C#: A multi-threaded UDP server with BackgroundWorker.

C#: A multi-threaded UDP server with BackgroundWorker.

The following code shows you how to build a UDP server in C# using the UUdpClient class for the networking and BackgroundWorker class for reporting data back to the application. This particular UDP server class is designed to be used with a Windows Forms or GUI. When using the UDP server you pass a BackgroundWorker [...]

Simple Sockets

Simple Sockets is a cross platform socket library. It is different from other socket libraries which mix the application protocol and transport protocol layer (i.e. TCP sockets, UDP sockets, HTTP sockets, etc). This library focuses specifically on the transport protocols. Its features include blocking/non-blocking sockets, polling, thread safety, and signal safety.
This example [...]

C# TCP/IP Client Server example code.

Below is example code written in C# for a TCP/IP client and server. The TCP server uses what is called a Listener object, which listens for incoming connections. On the client side, the code is written to connect to a specific IP address at which point the server side makes a connection and both client [...]

How to send email attachments in C#.

How to send email attachments in C#.

.NET provides an easy to use programming framework for developing applications. There are built in classes to do just about anything including email. Emailing with attachments isn’t as hard as you might think. You can email from the local host or an SMTP server with the <strong>SmtpClient</strong> class with just a [...]

Making a simple ListBox with GTK and Glade3.

Adding a simple ListBox widget in your GTK application is easier than you think. This tutorial will show you how to create ListBox-like functionality in GTK using Glade3. GTK uses the TreeView control as their do-all list control. You can create simple lists, tree-like lists and all sorts of various list views. What is really [...]

Read More »

Glade 3 + GtkBuilder + Anjuta Example.

Today I whipped up a simple GTK application using the Anjuta IDE, Glade 3, and the new GtkBuilder system. As some of you know, Glade 3 and GTK changed things up. First Glade stopped using generated code which required you to use libglade. Now the GTK developers created their own interface interpretor called GtkBuilder. [...]

Read More »

Get Windows Service info in C#.

This code will show you how to search for Windows Services. The ServiceController class handles almost everything service related. You can also check if services are running by checking the service.Status property and you can search for installed services using the sample code below. The services we are talking about are the services that run [...]

Read More »

Visual Basic comes to Linux.

Visual Basic for Linux is here, sort of. In my search for the perfect RAD environment for Linux I came across a project called Gambas. Gambas is a Visual Basic like development environment for Linux which is very much like Microsoft’s drag and drop Visual Basic but it is not a clone. For an Open [...]

Read More »

Add background color to PNG files in C#.

This code snippet will let you force a background color into a PNG file with C#. When working with PNG files in Visual Studio sometimes you’ll run into situations where the background of a PNG shows up as grey or even blue. This is because of the PNG files transparency and Windows can sometimes [...]

Read More »

C#: A multi-threaded UDP server with BackgroundWorker.

The following code shows you how to build a UDP server in C# using the UUdpClient class for the networking and BackgroundWorker class for reporting data back to the application. This particular UDP server class is designed to be used with a Windows Forms or GUI. When using the UDP server you pass a BackgroundWorker [...]

Read More »