Add background color to PNG files in C#.

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 [...]

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 [...]

Check for a Windows service in C#.

Check for a Windows service in C#.

This code will check through a list of installed Windows Services for a specific service name in C# (returns boolean). The function allows you to pass a service name as a string and the function will check the Windows Service list for that name. It will also look for partial service names in case you [...]

Strip email addresses from HTML or Text with C#.

Strip email addresses from HTML or Text with C#.

This code shows you how to extract email addresses out of text and HTML documents. Some day you may need to strip email address from text, for what reason you would want to do this I leave to you, but hopefully not for spam. You can also find phone numbers, web addresses and other patterned [...]

Linux GUI Programming with GTK#, Hello World.

Linux GUI Programming with GTK#, Hello World.

Today I was sitting next to a nice warm stove up in Vermont looking at some Linux Application code I’ve developed in the past. I thought, what a good time to make a quick and dirty “Hello World” GTK# tutorial. GTK# is the equivalent in Linux as Visual Studio is to Windows and both use [...]

Convert C# code to Visual Basic,Python and Back.

Some of you .NET programmers may some day find some sample code written in Visual Basic, or C#, but need it in another .NET language. SharpDevelop, a free .NET IDE, has a tool built in that will convert C# into Visual Basic and Python, or Visual Basic into C#, Python and any variation. This video [...]

Implement an RSS reader into your .NET program.

If you’re looking for RSS support in your .NET application head over to RSSdotnet.com and download the latest RSS.NET library. They provide all the source code and API documents you need to add RSS into your program. I haven’t thoroughly reviewed the code but it does work pretty code and seems stable. I’m currently using [...]

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 [...]

Using proxy servers in your C# applications.

This code snippet will show you how to use a proxy server in conjunction with the WebClient class. I’m pretty sure the WebClient class automatically uses your IE configuration (correct me if I’m wrong). This is helpful for those that are developing C# in Linux, but are behind an annoying corporate proxy server.

[...]

The underlying connection was closed.

There seems to be a big problem with the underlying code behind the sockets classes that Microsoft uses in their .NET framework. Many people are getting a “The underlying connection was closed.” error message, but there doesn’t seem to be an consistency to it.

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 »