Sample Code
-
Convert RTF to HTML
by Brady H
A visual basic module allowing you to convert a formatted RTF file to HTML!
-
Deep clone an object in .NET
by James Crowley
A simple code snippet that deep-copies an object by serializing and de-serializing using the BinaryFormatter
-
Read MP3 Tag Information (ID3v1 and ID3v2)
by Erin Jones
This sample source code demonstrates how to read IP3v1 and IP3v2 tag information from MP3's, along with MPEG headers too.
-
Create Controls At Runtime
by Colin Harman MACITP
Shows how to create controls at runtime and set their properties
-
Placing results from DataReader into an Array
by Edward Tanguay
Since a connection cannot be used until a DataReader has been closed, it is quite often necessary to read the results of a DataReader into an array, then close the DataReader, then you can process the data in the array while you use the connection for something else. This shows you how.
-
Start a Process as a Different User
by Peter Rekdal Sunde
This tutorial will help you learn how to start a process as another user e.g. the Administrator account.
-
Send & Receive Emails using Winsock and POP3
by Kym Manson
Demonstrates how to send & receive emails from a POP3 server using the Winsock control.
-
Validating an Integer
by Simon Soanes
How to validate an Integer the fast/efficient way in C# using Double.TryParse()
-
Generate an Image of a Web Page
by Alan Dean
Demonstrates how to fetch images and thumbnails of web pages using a hidden web browser control.
-
Is an Internet Connection Available?
by Karl Moore
Check if an internet connection is available using this simple code snippet.
-
FTP client library for C#
by Dan Glass
An FTP client library for C#, including asynchronous operation
-
Create Hashes - MD5, SHA1, SHA256, SHA384, SHA512
by David Cumps
In PHP its a simple task to generate hashes, but in C# it takes a little more work. We'll create a Hash class to simplify the process.
-
Encrypting Web.config sections in ASP.NET 2.0
by Xavier Larrea
Learn how to encrypt any section of your Web.config file on-the-fly and programatically; plain-text connection strings in your config file are no more!
-
Close a message box automatically
by James Crowley
How to automatically close a message box after a number of seconds.
-
Convert Decimal Integer Values to Binary String in VB6
by Alex Etchells
A small function to convert decimal integer values to a binary string. The number of bits can be optionally specified but this will be increased if insufficient.
-
Dynamically Adding OPTIONS to SELECT
by Bruce Johnson
How To: Dynamically Add an OPTION to a SELECT in a browser
-
How to write to an XML file
by Edward Tanguay
Writing to XML files is quite easy in ASP.NET as there are so many objects prepared for you -- you just need the syntax on how to use them. This code shows you how to write a simple member XML file.
-
Calculate the difference between two dates, ignoring weekends
by joki
This code allows calculating with dates as if there were no weekends. To achieve this, days are numbered from Monday, 29 December 1969 without any intervening weekends (that is, five days per week). One purpose is to calculate the number of working days in a month, ignoring further public and bank holidays.
-
Deleting duplicate rows in a table
by Kevin Saitta
Eliminating duplicate rows of data from an Oracle database
-
Dynamic thumbnail images from ASP.NET
by Brock Allen
This sample code is an IHttpHandler implementation that reads a JPG from the filesystem and dynamically generates a thumbnail sized version of the image and emits that to the response stream. What I like about this approach is that you don't need to create a file on the filesystem for the thumbnail as it's all done in memory.