Controlling complexity is the essence of computer programming. --Brian Kernigan
Welcome to my blog and project site for Microsoft.NET development.

I've been a full time .NET developer for ten years, but I didn't start my professional life as a programmer ... more
Share/Print this page:

Category: C#

languages
c#
[Articles: 27]

Sort:Most RecentUpdatedAuthorPagesViews TodayTotal Views 

Easily Build An Atom or RSS Feed With C# and the Syndication Namespace

By steve on January 13, 2012.  |  Updated on January 25, 2012.  |  206 views, 5 today.  |  1 page.
 ATOM  C#  How To  RSS  Web 
Learn how easy it can be to wireup a syndication feed for your site. The .NET framework allows you to build the feed content once and publish it using either the RSS or Atom protocol.

Convert String to Int in C#

By steve on November 05, 2011.  |  Updated on January 22, 2012.  |  418 views, 1 today.  |  1 page.
 .NET  C#  Conversions  Data Types  Snippet  Text and Strings 
Three different ways to convert a string to an integer in C# and the pros and cons of each.

Delegate Syntax and Usage in C#

By steve on September 01, 2007.  |  Updated on January 22, 2012.  |  17,153 views, 9 today.  |  1 page.
 C#  Delegates  Events  How To  Overview 
How to create a delegate in C#.

Partial Classes in .NET

By steve on May 26, 2007.  |  Updated on January 22, 2012.  |  31,694 views, 16 today.  |  1 page.
 ASP.NET  C#  Has Downloads  Has Images  Overview  Visual Studio 
Discover what partial classes are in .NET and what they're good for.

How to scrape or download a webpage using C#

By ktb on March 05, 2007.  |  Updated on January 22, 2012.  |  31,969 views, 25 today.  |  1 page.
 ASP.NET  C#  Snippet  Web 
A quick and dirty snippet for the basic approach to scraping the HTML content from a webpage programmatically.

How Do I Read a File As an Array of Bytes in C#

By steve on February 16, 2007.  |  Updated on January 22, 2012.  |  24,850 views, 83 today.  |  1 page.
 .NET  C#  IO  Snippet 
Learn how to use a stream to read the byte content of a file. You can also use the new ReadAllBytes method on the File class.

Online Random Number Generator

By steve on February 14, 2007.  |  Updated on January 22, 2012.  |  10,381 views, 4 today.  |  1 page.
 C#  Data Types  Has Downloads  Has Images  Math and Statistics  Snippet 
Need random numbers? Learn more about our online generator of random numbers.

PathHelper - Convert File and Folder Paths and URLs in an ASP.NET Application

By steve on February 13, 2007.  |  Updated on January 22, 2012.  |  21,800 views, 8 today.  |  2 pages.
 ASP.NET  C#  Has Downloads  Has Images  Snippet 
Managing all the various types of paths in ASP.NET can be a chore. You have URLs, virtual paths, absolute paths, relative paths and application paths. This article helps you make sense of all of these while managing conversions and getting the type of path you need when you need it.

Extract Keywords from a Search String in C#

By steve on January 27, 2007.  |  Updated on January 22, 2012.  |  28,547 views, 12 today.  |  1 page.
 .NET  C#  Has Downloads  Has Images  Regular Expressions  Snippet  Text and Strings 
A better way than String.Split to extract words from a string.

How Can I Easily Manage an XML Configuration File in .NET?

By steve on January 10, 2007.  |  Updated on January 22, 2012.  |  40,061 views, 50 today.  |  1 page.
 .NET  C#  Data  IO  Snippet  XML 
.NET makes reading and writing XML as easy as pie. Use a class template and you never have to deal with XML at all.

How Do I Get Paths and URL fragments from the HttpRequest object?

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  81,987 views, 129 today.  |  1 page.
 ASP.NET  C#  Snippet  Web 
A reference for extracting URL and path information from the HttpRequest object in ASP.NET.

What is Request.AcceptTypes in ASP.NET

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  5,382 views, 9 today.  |  1 page.
 ASP.NET  C#  Overview  Web Browsers  Web Design 
What the heck is Request.AcceptTypes in ASP.NET?

Using the HttpContext object

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  50,022 views, 22 today.  |  1 page.
 .NET  ASP.NET  C#  Server side  Snippet  Web 
Learn how you can get access to the HttpContext object when you're not in the code-behind of an ASPX page?

Extract Hex Digits From a String

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  10,021 views, 5 today.  |  1 page.
 .NET  C#  Conversions  Regular Expressions  Snippet  Text and Strings 
Learn how to extract hex digits from a string using C#. Useful for cases where you have dirty hex information or extra characters.

Parsing Email Addresses with Regular Expressions

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  82,470 views, 70 today.  |  1 page.
 .NET  C#  Email  Policy and Standards  Regular Expressions  Snippet 
Use C# to parse and validation email address. I present both a strict and lenient regular expression and discuss what constitutes a valid email address.

Parsing URLs with Regular Expressions and the Regex Object

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  47,605 views, 28 today.  |  2 pages.
 .NET  C#  Overview  Policy and Standards  Regular Expressions  Snippet  Text and Strings  Web 
Go in depth in understanding the structure of a URL or URI and see a single regular expression that can be used to extract the various pieces in one fell swoop.

Convert Integer To Enum Instance in C#

By steve on January 09, 2007.  |  Updated on January 01, 2012.  |  223,944 views, 103 today.  |  1 page.
 .NET  C#  Conversions  Enums  Snippet 
Sample C# code showing how to convert an integer to an instance of an enumeration.

Convert String to Enum Instance

By steve on January 09, 2007.  |  Updated on January 15, 2012.  |  186,698 views, 235 today.  |  1 page.
 .NET  C#  Conversions  Enums  Snippet  Text and Strings 
C# code sample showing how to convert a string to an instance of an enumeration.

Convert Hex String to .NET Color

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  95,701 views, 110 today.  |  1 page.
 .NET  C#  Conversions  CSS  HTML  Snippet 
Learn an easy way and a hard way to convert a hex string to a .NET color using C#.

Convert .NET Color to Hex String

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  41,616 views, 50 today.  |  1 page.
 .NET  C#  Conversions  CSS  HTML  Snippet 
Learn how to convert a hex string to a .NET color using C#.

Set Initial Focus on an ASP.NET Page

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  17,900 views, 6 today.  |  1 page.
 C#  Client side  Javascript  Snippet  Web  Web Browsers 
Here's a C# snippet to set the initial focus when a page loads. It takes into account some of the quirks with different types of controls and HTML elements.

C# StyleHelper Class

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  12,967 views, 5 today.  |  1 page.
 C#  CSS  Snippet  Web  Web Design 
While CSS is the preferred way to manage webpage styles these days, sometimes it's helpful to manage those styles programmatically.

C# RandomProvider Class

By steve on January 09, 2007.  |  Updated on January 22, 2012.  |  18,097 views, 13 today.  |  1 page.
 .NET  C#  Math and Statistics  Snippet 
I provide a class, RandomProvider, which provides random numbers for several of the .NET data types and based on statistical distributions.

C# StopWatch Class

By steve on January 07, 2007.  |  Updated on January 22, 2012.  |  45,530 views, 18 today.  |  1 page.
 .NET  C#  Performance  Snippet 
A high precision stop watch class for timing in your C# or .NET programs

Hexadecimal (Hex) to Decimal Lookup Table

By steve on January 07, 2007.  |  Updated on January 22, 2012.  |  130,622 views, 230 today.  |  2 pages.
 .NET  C#  Reference  Snippet  Web Design 
Convert hex to decimal. Convert dec to hexadecimal. This handy lookup table is a lot easier than punching it into your calculator.

Custom HyperLink Column for DataGrid

By steve on January 07, 2007.  |  Updated on January 22, 2012.  |  42,771 views, 23 today.  |  1 page.
 .NET Controls  C#  Data  Snippet  SQL Server 
Detailed example with code showing how to add a custom link column to a datagrid.

Adding Columns to DataGrid Programmatically

By steve on January 01, 2007.  |  Updated on January 22, 2012.  |  82,273 views, 50 today.  |  2 pages.
 .NET Controls  ASP.NET  C#  Data  Snippet  SQL Server 
Demonstration and code for programmatically adding a custom column to a DataGrid.