Click here to Skip to main content
12,954,199 members (51,703 online)

Articles by John Simmons / outlaw programmer (Articles: 58, Tip/Tricks: 74)

Articles: 58, Tip/Tricks: 74

RSS Feed

Average article rating: 4.34

Clipboard
General
Posted: 16 Oct 2001   Updated: 15 Apr 2008   Views: 148,865   Rating: 3.74/5    Votes: 48   Popularity: 6.29
Licence: The Code Project Open License (CPOL)      Bookmarked: 54   Downloaded: 1,425
Helps with copying a device independant bitmap to the clipboard.
Dialogs and Windows
Dialogs
Posted: 26 Nov 2000   Updated: 16 Apr 2001   Views: 91,753   Rating: 2.98/5    Votes: 22   Popularity: 4.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 27   Downloaded: 1,957
Technique for utilizing a CResizablePage in a CFormView-derived class
Posted: 14 Dec 2008   Updated: 24 Jun 2010   Views: 111,785   Rating: 4.85/5    Votes: 53   Popularity: 8.37
Licence: The Code Project Open License (CPOL)      Bookmarked: 172   Downloaded: 3,391
Create a dynamically resizable wizard form
Form Views
Posted: 28 Nov 2000   Updated: 6 Jun 2001   Views: 165,028   Rating: 3.50/5    Votes: 40   Popularity: 5.48
Licence: Not specified      Bookmarked: 45   Downloaded: 2,407
Extension of Paolo Messina's CResizableDialog concept
General
Posted: 9 Aug 2005   Updated: 9 Aug 2005   Views: 62,400   Rating: 3.54/5    Votes: 26   Popularity: 4.92
Licence: Not specified      Bookmarked: 23   Downloaded: 887
Enumerate all controls in a dialog box or form view.
Document / View
General
Posted: 21 Jan 2001   Updated: 7 May 2001   Views: 91,927   Rating: 2.90/5    Votes: 30   Popularity: 4.40
Licence: The Code Project Open License (CPOL)      Bookmarked: 36   Downloaded: 1,763
Track a mouse click, even in a scrolled view
Files and Folders
Configuration Files
Posted: 27 Jan 2007   Updated: 27 Jan 2007   Views: 51,909   Rating: 4.56/5    Votes: 24   Popularity: 6.29
Licence: The Code Project Open License (CPOL)      Bookmarked: 44   Downloaded: 650
Implement XML application profiles that are similar (but not too similar) to using INI files
File System
Posted: 14 Feb 2010   Updated: 17 Dec 2010   Views: 204,624   Rating: 4.92/5    Votes: 101   Popularity: 9.86
Licence: The Code Project Open License (CPOL)      Bookmarked: 283   Downloaded: 12,119
How to get all the events you want - whether you need them or not.
Posted: 14 Feb 2010   Updated: 17 Dec 2010   Views: 101,265   Rating: 4.91/5    Votes: 75   Popularity: 9.20
Licence: The Code Project Open License (CPOL)      Bookmarked: 154   Downloaded: 1
Use the demo application (from Part 1) to observe events posted when creating files in the watched folder
General
Posted: 5 Feb 2011   Updated: 7 Feb 2011   Views: 39,468   Rating: 4.89/5    Votes: 26   Popularity: 6.90
Licence: The Code Project Open License (CPOL)      Bookmarked: 100   Downloaded: 2,639
Windows service for synchronizing folders
Utilities
Posted: 12 Sep 2016   Updated: 29 Sep 2016   Views: 43,804   Rating: 4.82/5    Votes: 35   Popularity: 7.45
Licence: The Code Project Open License (CPOL)      Bookmarked: 58   Downloaded: 1,264
Parse CSV files.
List Controls
List Controls
Posted: 8 Dec 2002   Updated: 8 Dec 2002   Views: 188,917   Rating: 3.42/5    Votes: 45   Popularity: 5.65
Licence: Not specified      Bookmarked: 32   Downloaded: 0
Some dialogbox code to give the Blonde a clue
Menus
Custom menus
Posted: 26 Jan 2007   Updated: 26 Jan 2007   Views: 79,055   Rating: 3.19/5    Votes: 65   Popularity: 5.72
Licence: The Code Project Open License (CPOL)      Bookmarked: 38   Downloaded: 1,154
Add menu items to, and learn how to handle the system menu
General
Posted: 12 May 2005   Updated: 12 May 2005   Views: 112,499   Rating: 3.10/5    Votes: 39   Popularity: 4.93
Licence: Not specified      Bookmarked: 36   Downloaded: 0
Build a menu and/or a toolbar dynamically without using resource files (well, almost).
Miscellaneous
General
Posted: 13 Oct 2008   Updated: 11 Dec 2010   Views: 93,322   Rating: 4.48/5    Votes: 48   Popularity: 7.52
Licence: The Code Project Open License (CPOL)      Bookmarked: 94   Downloaded: 619
Scrape the My Articles page here on CodeProject to keep an eye on your articles.
Posted: 11 Dec 2010   Updated: 13 Nov 2011   Views: 83,879   Rating: 4.95/5    Votes: 51   Popularity: 8.45
Licence: The Code Project Open License (CPOL)      Bookmarked: 69   Downloaded: 1,299
New and improved! Keep an eye on your CodeProject articles and reputation without having to log onto CP.
Grid Control
Posted: 13 May 2005   Updated: 13 May 2005   Views: 55,735   Rating: 3.18/5    Votes: 26   Popularity: 4.46
Licence: The Code Project Open License (CPOL)      Bookmarked: 11   Downloaded: 874
Create blinking cells for Chris Maunder's grid control.
Windows Forms
Posted: 2 Oct 2008   Updated: 2 Oct 2008   Views: 123,291   Rating: 4.44/5    Votes: 61   Popularity: 7.91
Licence: The Code Project Open License (CPOL)      Bookmarked: 134   Downloaded: 4,231
Discusses windows authentication and application-specific authentication for WinForm applications
Printing
General
Posted: 4 Jan 2009   Updated: 4 Jan 2009   Views: 51,868   Rating: 4.91/5    Votes: 27   Popularity: 7.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 50   Downloaded: 1,331
A utility that you can use to "exercise" your inkjet printer without wasting a lot of ink or paper
Web Services
General
Posted: 26 May 2010   Updated: 27 May 2010   Views: 29,493   Rating: 4.95/5    Votes: 16   Popularity: 5.96
Licence: The Code Project Open License (CPOL)      Bookmarked: 19   Downloaded: 0
With some earlier design forethought, I was able to inject some significant code optimization into a current project.
Windows Phone 7/8
Windows Mobile
Posted: 22 Dec 2003   Updated: 22 Dec 2003   Views: 74,832   Rating: 3.51/5    Votes: 18   Popularity: 4.41
Licence: The Code Project Open License (CPOL)      Bookmarked: 24   Downloaded: 0
Add a scrollbar to a property page when the SIP is displayed.
GDI+
General
Posted: 28 Nov 2006   Updated: 8 May 2007   Views: 109,508   Rating: 4.43/5    Votes: 95   Popularity: 9.42
Licence: Not specified      Bookmarked: 97   Downloaded: 0
A method for programatically determining the appropriate foreground color based on the specified background color
General Graphics
Bitmaps
Posted: 28 Jul 2006   Updated: 28 Jul 2006   Views: 42,606   Rating: 3.73/5    Votes: 32   Popularity: 5.62
Licence: The Code Project Open License (CPOL)      Bookmarked: 28   Downloaded: 447
Copy a bitmap over a portion of another bitmap
Posted: 28 Sep 2008   Updated: 28 Sep 2008   Views: 44,594   Rating: 4.45/5    Votes: 28   Popularity: 6.41
Licence: The Code Project Open License (CPOL)      Bookmarked: 43   Downloaded: 996
Put text on a bitmap, make your winform app go full-screen, and say hello to some simple LINQ code.
C / C++ Language
General
Posted: 3 Aug 2006   Updated: 3 Aug 2006   Views: 24,326   Rating: 3.67/5    Votes: 11   Popularity: 3.82
Licence: Not specified      Bookmarked: 12   Downloaded: 131
A passable workaround for the COleDateTime formatting behavior in MFC8.
Posted: 27 Jan 2007   Updated: 27 Jan 2007   Views: 29,225   Rating: 4.63/5    Votes: 21   Popularity: 6.12
Licence: The Code Project Open License (CPOL)      Bookmarked: 17   Downloaded: 379
The right way to code using CodeProject for occasional support
Posted: 27 Jan 2007   Updated: 15 Apr 2008   Views: 49,725   Rating: 4.77/5    Votes: 43   Popularity: 7.79
Licence: The Code Project Open License (CPOL)      Bookmarked: 94   Downloaded: 544
The right way to code using CodeProject for occasional support
Posted: 27 Jan 2007   Updated: 15 Apr 2008   Views: 32,604   Rating: 4.80/5    Votes: 25   Popularity: 6.71
Licence: The Code Project Open License (CPOL)      Bookmarked: 24   Downloaded: 610
The right way to code using CodeProject for occasional support
Posted: 27 Jan 2007   Updated: 15 Apr 2008   Views: 26,732   Rating: 4.55/5    Votes: 20   Popularity: 5.92
Licence: The Code Project Open License (CPOL)      Bookmarked: 18   Downloaded: 380
The right way to code using CodeProject for occasional support
Posted: 27 Jan 2007   Updated: 12 Jan 2010   Views: 47,835   Rating: 4.65/5    Votes: 22   Popularity: 6.24
Licence: The Code Project Open License (CPOL)      Bookmarked: 27   Downloaded: 448
The right way to code using CodeProject for occasional support
C#
Applications
Posted: 14 Aug 2011   Updated: 20 Aug 2011   Views: 25,518   Rating: 4.83/5    Votes: 22   Popularity: 6.46
Licence: The Code Project Open License (CPOL)      Bookmarked: 24   Downloaded: 1,278
Keep more detailed track of your Codeproject reputation points.
Posted: 20 Aug 2011   Updated: 30 Aug 2011   Views: 20,437   Rating: 4.82/5    Votes: 8   Popularity: 4.34
Licence: The Code Project Open License (CPOL)      Bookmarked: 14   Downloaded: 861
Keep more detailed track of your Codeproject reputation points.
Posted: 14 Aug 2011   Updated: 30 Aug 2011   Views: 30,984   Rating: 4.92/5    Votes: 34   Popularity: 7.53
Licence: The Code Project Open License (CPOL)      Bookmarked: 42   Downloaded: 746
Keep more detailed track of your Codeproject reputation points.
Posted: 14 Aug 2011   Updated: 20 Sep 2012   Views: 22,985   Rating: 4.82/5    Votes: 19   Popularity: 6.16
Licence: The Code Project Open License (CPOL)      Bookmarked: 14   Downloaded: 406
Keep more detailed track of your Codeproject reputation points.
Attributes
Posted: 27 Sep 2016   Updated: 27 Sep 2016   Views: 11,075   Rating: 5.00/5    Votes: 19   Popularity: 6.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 30   Downloaded: 172
Abusing attributes, and loving it.
General
Posted: 17 May 2008   Updated: 17 May 2008   Views: 39,926   Rating: 4.30/5    Votes: 18   Popularity: 5.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 29   Downloaded: 207
One method for loading common and object-specific data from your app.config file.
Posted: 17 Dec 2008   Updated: 17 Dec 2008   Views: 41,796   Rating: 5.00/5    Votes: 10   Popularity: 4.73
Licence: The Code Project Open License (CPOL)      Bookmarked: 46   Downloaded: 491
A not-so-dotNet way to allow multiple programs to share a single settings file
Posted: 6 Oct 2016   Updated: 11 Oct 2016   Views: 12,564   Rating: 4.90/5    Votes: 30   Popularity: 7.24
Licence: The Code Project Open License (CPOL)      Bookmarked: 49   Downloaded: 520
A GPS class with a coordinate parser, distance calculation, and bearing calculation.
VBScript
General
Posted: 7 May 2007   Updated: 7 May 2007   Views: 21,663   Rating: 3.57/5    Votes: 9   Popularity: 3.40
Licence: The Code Project Open License (CPOL)      Bookmarked: 17   Downloaded: 0
The VBScript version of my C# article about the very same thing
STL
Collections and Iterators
Posted: 9 Dec 2002   Updated: 9 Dec 2002   Views: 95,457   Rating: 3.18/5    Votes: 23   Popularity: 4.33
Licence: The Code Project Open License (CPOL)      Bookmarked: 14   Downloaded: 0
One technique for performing a binary insertion sort on a std::list
Windows Presentation Foundation
Applications
Posted: 14 Oct 2012   Updated: 4 Nov 2012   Views: 34,378   Rating: 4.97/5    Votes: 16   Popularity: 5.99
Licence: The Code Project Open License (CPOL)      Bookmarked: 39   Downloaded: 1,141
My Anagrams game ported to WPF.
Controls
Posted: 13 Apr 2016   Updated: 13 Apr 2016   Views: 6,735   Rating: 4.98/5    Votes: 13   Popularity: 5.54
Licence: The Code Project Open License (CPOL)      Bookmarked: 17   Downloaded: 217
Any technology suitably advanced will generally be viewed as "magic".
Utilities
Posted: 16 Dec 2014   Updated: 16 Dec 2014   Views: 27,471   Rating: 4.77/5    Votes: 30   Popularity: 7.06
Licence: The Code Project Open License (CPOL)      Bookmarked: 21   Downloaded: 1
Eliminate the tedium of generating model and viewmodel classes for your WPF projects, and save a butt-load of time in the process.
Algorithms & Recipes
Parsers and Interpreters
Posted: 30 Jul 2007   Updated: 21 Dec 2008   Views: 54,014   Rating: 4.33/5    Votes: 19   Popularity: 5.53
Licence: A Public Domain dedication      Bookmarked: 38   Downloaded: 281
Parse a string with quoted elements, insert/add/delete elements, and is CLS compliant
Cryptography & Security
General
Posted: 4 Oct 2010   Updated: 5 Oct 2010   Views: 44,009   Rating: 4.92/5    Votes: 20   Popularity: 6.38
Licence: The Code Project Open License (CPOL)      Bookmarked: 41   Downloaded: 334
One way to create a completely random encryption key, and sharing it with a client application
Date and Time
Tools
Posted: 1 Oct 2008   Updated: 1 Oct 2008   Views: 45,917   Rating: 4.69/5    Votes: 55   Popularity: 8.17
Licence: The Code Project Open License (CPOL)      Bookmarked: 82   Downloaded: 491
Implement repetitive tasks at consistent intervals
DLLs & Assemblies
General
Posted: 30 Nov 2006   Updated: 30 Nov 2006   Views: 121,501   Rating: 4.03/5    Votes: 53   Popularity: 6.90
Licence: The Code Project Open License (CPOL)      Bookmarked: 48   Downloaded: 1,146
Two methods to retrieve the path/name of a VS2002 or higher DLL from within that DLL.
Game Development
Games
Posted: 7 Apr 2008   Updated: 4 Nov 2012   Views: 95,206   Rating: 4.70/5    Votes: 35   Popularity: 7.19
Licence: The Code Project Open License (CPOL)      Bookmarked: 70   Downloaded: 3,221
The classic word game using words and letter scores allowed in Scrabble
Programming Tips
Design and Strategy
Posted: 4 Dec 2006   Updated: 4 Dec 2006   Views: 104,044   Rating: 3.16/5    Votes: 40   Popularity: 5.05
Licence: The Code Project Open License (CPOL)      Bookmarked: 19   Downloaded: 0
Compare floating point numbers for equality at programmer-specified precision.
String handling
General
Posted: 11 Dec 2001   Updated: 12 Dec 2001   Views: 178,678   Rating: 3.39/5    Votes: 32   Popularity: 5.10
Licence: The Code Project Open License (CPOL)      Bookmarked: 18   Downloaded: 0
A small function to either accept or create a UUID* and return a CString
Posted: 19 Jan 2001   Updated: 14 Mar 2002   Views: 169,910   Rating: 3.89/5    Votes: 53   Popularity: 6.70
Licence: Not specified      Bookmarked: 45   Downloaded: 1,222
Parse strings with specified delimiter and specified quote character
Posted: 17 Nov 2006   Updated: 17 Nov 2006   Views: 76,276   Rating: 3.79/5    Votes: 24   Popularity: 5.23
Licence: Not specified      Bookmarked: 11   Downloaded: 0
A technique for making stdio functions compile clean regardless of the Microsoft compiler used
Text Conversion
Posted: 12 Feb 2015   Updated: 23 Feb 2015   Views: 20,493   Rating: 4.96/5    Votes: 27   Popularity: 7.10
Licence: The Code Project Open License (CPOL)      Bookmarked: 37   Downloaded: 294
Spell it out! No! Wait!
Threads, Processes & IPC
Thread Pooling
Posted: 7 Feb 2010   Updated: 17 Mar 2010   Views: 106,328   Rating: 4.94/5    Votes: 73   Popularity: 9.21
Licence: The Code Project Open License (CPOL)      Bookmarked: 305   Downloaded: 2,673
Tie it all together and not lose your mind in the process
Debug Tips
General
Posted: 29 Nov 2006   Updated: 29 Nov 2006   Views: 43,482   Rating: 4.53/5    Votes: 21   Popularity: 5.98
Licence: Not specified      Bookmarked: 29   Downloaded: 637
Here's some code that will automatically start your app on a secondary monitor if it's compiled with debug info.
Work Issues
The Developer's Life
Posted: 24 Oct 2008   Updated: 12 Oct 2016   Views: 189,071   Rating: 4.82/5    Votes: 254   Popularity: 11.59
Licence: The Code Project Open License (CPOL)      Bookmarked: 202   Downloaded: 0
My views on how to be a proper programmer
Hardware & System
Hardware
Posted: 14 Apr 2008   Updated: 10 Jan 2011   Views: 258,991   Rating: 4.93/5    Votes: 72   Popularity: 9.16
Licence: The Code Project Open License (CPOL)      Bookmarked: 129   Downloaded: 0
How to go about buildingyour own NAS device
Interviews
General
Posted: 14 Sep 2011   Updated: 14 Sep 2011   Views: 40,834   Rating: 4.97/5    Votes: 52   Popularity: 8.53
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
Welcome to our continuing series of Code Project interviews in which we talk to developers about their backgrounds, projects, interests and pet peeves. In this installment we track down Code Project member John Simmons.
No blogs have been submitted.

Average tips rating: 4.87

Dialogs and Windows
General
Posted: 28 Feb 2010   Updated: 21 May 2010   Views: 45,423   Rating: 4.92/5    Votes: 6   Popularity: 3.74
Licence: The Code Project Open License (CPOL)      Bookmarked: 6   Downloaded: 0
Control resizing is a bit more mysterious than it might appear at first glance.
Posted: 22 Nov 2011   Updated: 22 Nov 2011   Views: 11,452   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
Allow any nnumber of forms to be used as a main form with easy transitions between forms.
Posted: 21 Jan 2010   Updated: 22 Nov 2011   Views: 46,299   Rating: 4.88/5    Votes: 41   Popularity: 7.85
Licence: The Code Project Open License (CPOL)      Bookmarked: 24   Downloaded: 0
A useful technique that could be used for winform apps which require a login dialog.
Grid & Data Controls
General
Posted: 10 Nov 2011   Updated: 10 Nov 2011   Views: 5,251   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
If you use DataSet.GetXML, it returns the Dataset in the form of a XML string. Using Dataset.ReadXml will populate a Dataset from an XML string (or a stream).Lastly, your premise for the tip itself is flawed. Ninety nine times out of 100, a report is indeed SUPPOSED to query the database. ...
Menus
General
Posted: 14 Sep 2011   Updated: 14 Sep 2011   Views: 36,887   Rating: 4.89/5    Votes: 10   Popularity: 4.80
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
How to automatically display a winforms menu when the mouse is hovered over an item
Posted: 9 Nov 2012   Updated: 9 Nov 2012   Views: 6,792   Rating: 4.89/5    Votes: 2   Popularity: 1.47
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Stuck on a really weird problem in WPF? Move your behind and write some code (behind).
ASP.NET
General
Posted: 3 Mar 2010   Updated: 23 Jun 2010   Views: 18,367   Rating: 4.89/5    Votes: 10   Popularity: 4.80
Licence: The Code Project Open License (CPOL)      Bookmarked: 14   Downloaded: 0
A low-impact method for getting the appropriate path on a web page.
Posted: 17 Jun 2011   Updated: 17 Jun 2011   Views: 7,870   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
Back-tracking to make sure code is processed before the current page executes
Posted: 21 Jun 2011   Updated: 21 Jun 2011   Views: 13,312   Rating: 4.55/5    Votes: 4   Popularity: 2.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
How to execute code in the current page AFTER navigating to a new page.
Posted: 22 Jun 2011   Updated: 23 Jun 2011   Views: 27,381   Rating: 4.82/5    Votes: 7   Popularity: 3.94
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
One way to guarantee uniqueness and avoid misspelling your session variable names
Silverlight
General
Posted: 20 Apr 2010   Updated: 21 May 2010   Views: 20,264   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Dorothy was right - there's no place like home.
Posted: 17 May 2010   Updated: 21 May 2010   Views: 10,293   Rating: 4.75/5    Votes: 5   Popularity: 3.15
Licence: The Code Project Open License (CPOL)      Bookmarked: 6   Downloaded: 0
Follow these guidelines for trouble-free dictionary merging in Silverlight
Posted: 9 Jun 2010   Updated: 9 Jun 2010   Views: 10,002   Rating: 4.86/5    Votes: 6   Popularity: 3.63
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
The Silverlight navigation app ErrorWindow exposes the last exception thrown, but doesn't show the INNER exceptions. Here's how you can do it.
Posted: 19 Jun 2010   Updated: 19 Jun 2010   Views: 12,003   Rating: 4.88/5    Votes: 6   Popularity: 3.70
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
What to do if you want to resue a style for more than one component of a particular type on a given Silverlight Page
Posted: 5 Aug 2010   Updated: 12 Aug 2010   Views: 14,086   Rating: 5.00/5    Votes: 10   Popularity: 5.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Get around another irrational and arbitrary omission in Silverlight
Posted: 11 Aug 2010   Updated: 12 Aug 2010   Views: 12,095   Rating: 5.00/5    Votes: 4   Popularity: 3.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
If you need to get the position the mouse was clicked, in relation to a specific UI Element, this might help
Posted: 7 Mar 2011   Updated: 7 Mar 2011   Views: 9,563   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
Extension method that checks for a properly Xaml-ized string
Posted: 9 May 2011   Updated: 9 May 2011   Views: 15,518   Rating: 4.95/5    Votes: 10   Popularity: 4.64
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
Get access to your Silverlight MainPage object
Web Security
General
Posted: 5 Jul 2011   Updated: 5 Jul 2011   Views: 3,150   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
I do it this way:0) Create a base page class, and store the current page's url (you can do this any number of ways, so I'll leave it to your imagination):public class MyBasepage : System.Web.UI.Page{ public string CurrentUrl { get; set; } }1) Store the page's Url to a...
Database
General
Posted: 5 Jan 2011   Updated: 5 Jan 2011   Views: 7,785   Rating: 4.89/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
You can also enclose your column name in brackets, like so: [Create Date]
Posted: 26 May 2011   Updated: 26 May 2011   Views: 8,753   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
When all else fails, fire off some events and bask in the glow of the IDE's Progress tab.
Posted: 26 Jul 2011   Updated: 26 Jul 2011   Views: 19,144   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
One way to effectively zero the columns any DataRow object.
Posted: 25 Jul 2011   Updated: 10 Aug 2011   Views: 73,344   Rating: 4.90/5    Votes: 36   Popularity: 7.60
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
Just say no to SELECT * in your SQL
SQL Server
Posted: 31 Jan 2017   Updated: 31 Jan 2017   Views: 4,152   Rating: 4.50/5    Votes: 5   Popularity: 3.06
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
A scalar function to determine if a given DateTime is one of the ten US federal holidays, using SQL Server.
Posted: 31 Jan 2017   Updated: 31 Jan 2017   Views: 5,011   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
Using common table expressions to build data from thin air.
General Graphics
General
Posted: 18 Feb 2011   Updated: 19 Feb 2011   Views: 26,368   Rating: 5.00/5    Votes: 8   Popularity: 4.52
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
Determine the number of unique colors in an image
C#
Date / Time
Posted: 31 Jan 2017   Updated: 31 Jan 2017   Views: 5,373   Rating: 4.82/5    Votes: 13   Popularity: 5.36
Licence: The Code Project Open License (CPOL)      Bookmarked: 8   Downloaded: 0
A DateTime extension method to determine if a given DateTime is one of the ten US federal holidays, using C#.
Posted: 1 Feb 2017   Updated: 1 Feb 2017   Views: 5,440   Rating: 4.94/5    Votes: 8   Popularity: 4.46
Licence: The Code Project Open License (CPOL)      Bookmarked: 8   Downloaded: 0
Figuring out when Easter occurs in a given year is based on the phase of the moon, the vernal equinox, and where in the world you are.
Posted: 1 Feb 2017   Updated: 1 Feb 2017   Views: 4,731   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 6   Downloaded: 0
Find the date of a specified federal holiday for a given year.
Delegates and Events
Posted: 25 Jul 2012   Updated: 25 Jul 2012   Views: 8,894   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 23
Evaluating epressions in an ad-hoc condition.
General
Posted: 3 Nov 2015   Updated: 3 Nov 2015   Views: 7,286   Rating: 4.43/5    Votes: 4   Popularity: 2.67
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
This is an alternative for "Compareing Two Complex objects of same class"
Posted: 13 Sep 2016   Updated: 13 Sep 2016   Views: 4,413   Rating: 4.71/5    Votes: 12   Popularity: 5.27
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
This came as a mild surprise
.NET Framework
General
Posted: 13 Jan 2010   Updated: 22 May 2010   Views: 23,022   Rating: 4.82/5    Votes: 22   Popularity: 6.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
Don't reinvent the wheel - use the one that's already on the cart.
Posted: 18 Jan 2010   Updated: 22 May 2010   Views: 17,896   Rating: 5.00/5    Votes: 17   Popularity: 6.15
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 0
Don't drink the kool-aid. You still need to know how to use the Windows API in .Net apps.
Posted: 5 Apr 2011   Updated: 6 Apr 2011   Views: 10,524   Rating: 5.00/5    Votes: 11   Popularity: 4.83
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
Never assume you know what the framework is going to do
Posted: 11 Sep 2013   Updated: 12 Sep 2013   Views: 22,621   Rating: 4.83/5    Votes: 6   Popularity: 3.76
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
One approach to find a specific exception type inside the containing exception
Posted: 5 Oct 2015   Updated: 5 Oct 2015   Views: 9,723   Rating: 4.40/5    Votes: 16   Popularity: 5.30
Licence: The Code Project Open License (CPOL)      Bookmarked: 11   Downloaded: 0
Yes, you CAN document your stored procs in C# code.
Windows Communication Foundation
General
Posted: 26 Jan 2011   Updated: 26 Jan 2011   Views: 22,277   Rating: 5.00/5    Votes: 6   Popularity: 3.89
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
When you need to communicate with the app that contains your ServiceHost object, use custom events
Windows Presentation Foundation
Controls
Posted: 15 Jun 2012   Updated: 15 Jun 2012   Views: 24,969   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
One way to get around the "invalid character" error
General
Posted: 29 May 2010   Updated: 29 May 2010   Views: 29,768   Rating: 4.73/5    Votes: 8   Popularity: 4.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
One technique for having a column width that grows/shrinks with ListView width
Posted: 17 Nov 2014   Updated: 17 Nov 2014   Views: 4,840   Rating: 4.00/5    Votes: 3   Popularity: 1.91
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
How to fix this ANNOYING problem
Algorithms & Recipes
General
Posted: 10 May 2011   Updated: 10 May 2011   Views: 18,473   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
See if an integer value is a valid value for the given "flags" enumerator
Posted: 7 Jul 2011   Updated: 7 Jul 2011   Views: 3,002   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
.Net 4 has the enum.HasFlag() method, which kinda obsoletes this tip. :)
Posted: 9 Aug 2012   Updated: 12 Nov 2012   Views: 15,625   Rating: 4.90/5    Votes: 3   Popularity: 2.34
Licence: The Code Project Open License (CPOL)      Bookmarked: 6   Downloaded: 208
Presenting a DateTime extension class that allows you to determine the actual date of the specified instance of the specified weekday within the specified month/year.
Cryptography & Security
General
Posted: 15 Oct 2014   Updated: 15 Oct 2014   Views: 7,893   Rating: 4.71/5    Votes: 7   Popularity: 3.98
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 0
Retrieve certificates from the system certificate store
Date and Time
General
Posted: 19 Jan 2011   Updated: 19 Jan 2011   Views: 19,158   Rating: 4.85/5    Votes: 14   Popularity: 5.44
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 0
Determine if specified date/time properrties are equal
Posted: 10 Nov 2011   Updated: 10 Nov 2011   Views: 8,005   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
How about this?public static class ExtendDateTime{ public int CountWeekDays(this DateTime thisdate, DateTime thatDate) { int days = Math.Abs((thisDate - thatDate).Days) + 1; return = ((days/7) * 5) + (days % 7); }}Usage would be like this:DateTime...
Posted: 27 Oct 2014   Updated: 27 Oct 2014   Views: 6,050   Rating: 4.77/5    Votes: 4   Popularity: 2.87
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Extension method to determine fiscal date
Posted: 6 Feb 2015   Updated: 6 Feb 2015   Views: 3,510   Rating: 4.80/5    Votes: 2   Popularity: 1.44
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
This is an alternative for "Partial DateTime Object Equality"
DLLs & Assemblies
General
Posted: 10 May 2013   Updated: 10 May 2013   Views: 3,731   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
Determine the nature of the entry assembly
Internet / Network
General
Posted: 7 May 2010   Updated: 21 May 2010   Views: 18,568   Rating: 4.81/5    Votes: 9   Popularity: 4.59
Licence: The Code Project Open License (CPOL)      Bookmarked: 9   Downloaded: 0
Make interfacing with your web service simpler and more maintainable
Posted: 6 Jun 2010   Updated: 6 Jun 2010   Views: 10,623   Rating: 4.77/5    Votes: 6   Popularity: 3.71
Licence: The Code Project Open License (CPOL)      Bookmarked: 8   Downloaded: 0
It's not as simple as just calling DirectoryInfo.GetFiles()
Programming Tips
General
Posted: 11 Apr 2010   Updated: 22 May 2010   Views: 13,854   Rating: 5.00/5    Votes: 4   Popularity: 3.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
Programatically set grid row/column sizes (yes, even "Auto", "*", and "X*" - thanks Nish).
Posted: 22 May 2010   Updated: 22 May 2010   Views: 29,280   Rating: 4.95/5    Votes: 7   Popularity: 4.17
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
In WPF/Silverlight, you might want to bind to a dictionary. Here's a couple of websites I found.
Posted: 4 Mar 2010   Updated: 26 Aug 2010   Views: 12,454   Rating: 4.83/5    Votes: 11   Popularity: 4.89
Licence: The Code Project Open License (CPOL)      Bookmarked: 12   Downloaded: 0
You probably have better things to do than writing tedious comparison methods.
Posted: 26 Dec 2010   Updated: 26 Dec 2010   Views: 6,401   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Can't you just call Enum.GetNames(), and then bind to the collection returned by that method?
Posted: 19 Jan 2011   Updated: 24 Jan 2011   Views: 39,362   Rating: 4.93/5    Votes: 31   Popularity: 7.33
Licence: The Code Project Open License (CPOL)      Bookmarked: 40   Downloaded: 0
How to make your app detect whether or not it's running in admin mode.
Posted: 1 Feb 2011   Updated: 2 Feb 2011   Views: 21,217   Rating: 4.97/5    Votes: 18   Popularity: 6.23
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 0
How to determine if your .Net app is running in the Visual Studio IDE
Posted: 9 Feb 2011   Updated: 9 Feb 2011   Views: 4,985   Rating: 5.00/5    Votes: 7   Popularity: 4.23
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
StringBuilder mystring = new StringBuilder("AbCd");for (int i = 0; i < mystring.Length; i++){ char c = mystring[i]; mystring[i] = Char.IsLower(c) ? Char.ToUpper(c) : Char.ToLower(c);}
Posted: 4 Apr 2011   Updated: 4 Apr 2011   Views: 10,363   Rating: 4.89/5    Votes: 18   Popularity: 6.08
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
What to do when the "you're a moron" epiphany smacks you in the head just after you've convinced yourself you're pretty clever.
Posted: 17 May 2011   Updated: 17 May 2011   Views: 5,491   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
This is how I do it (we determine the host and select the appropriate endpoint).// these are the endpoints define in the webconfig filestring LocalHostEndpointName = "LocalHost_Endpoint";string ProductionEndpointName = "Production_Endpoint";string CurrentEndpoint = "";//...
Posted: 20 Feb 2010   Updated: 9 Jul 2011   Views: 9,964   Rating: 5.00/5    Votes: 6   Popularity: 3.89
Licence: The Code Project Open License (CPOL)      Bookmarked: 6   Downloaded: 0
Avoid exceptions when setting enumerators from unknown/untrusted sources.
Posted: 23 Jul 2011   Updated: 23 Jul 2011   Views: 5,036   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
I wouldn't create a class for this. I'd make it an extension method, and then do this:public static class String Extensions{ public static string Reverse(this string value) { value = // do your reverse code here; return value; }}// Usage:string x...
Posted: 24 May 2010   Updated: 29 Aug 2011   Views: 23,955   Rating: 4.88/5    Votes: 21   Popularity: 6.38
Licence: The Code Project Open License (CPOL)      Bookmarked: 22   Downloaded: 0
Using a delegate could pull your butt out of the fire when you don't want to refactor code to add functionality.
Posted: 20 Dec 2011   Updated: 20 Dec 2011   Views: 13,032   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
You have everything you need to do your job as a developer. You just need to use them.
Posted: 23 Apr 2010   Updated: 10 Jul 2014   Views: 28,830   Rating: 4.80/5    Votes: 18   Popularity: 5.95
Licence: The Code Project Open License (CPOL)      Bookmarked: 15   Downloaded: 0
Extension methods can help you avoid sticky situations.
String handling
General
Posted: 1 Jan 2011   Updated: 1 Jan 2011   Views: 22,176   Rating: 4.82/5    Votes: 4   Popularity: 2.90
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
We're up to .Net 4 and MS *still* hasn't given us this simple functionality
Uncategorised Tips and Tricks
General
Posted: 11 Jul 2011   Updated: 11 Jul 2011   Views: 12,020   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
42!
Posted: 18 Apr 2013   Updated: 18 Apr 2013   Views: 28,307   Rating: 4.89/5    Votes: 2   Popularity: 1.47
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
Go here for an update that utilizes the Twitter API v1.1
Design and Architecture
General
Posted: 24 Jan 2010   Updated: 22 May 2010   Views: 6,551   Rating: 4.60/5    Votes: 3   Popularity: 1.43
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Essential programmer skill - the ability to approach a problem from more that one direction.
Testing and QA
General
Posted: 22 Jan 2010   Updated: 22 May 2010   Views: 6,442   Rating: 4.73/5    Votes: 9   Popularity: 4.40
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
No change is too small for a complete regression test.
Author Resources
General
Posted: 13 Jan 2010   Updated: 22 May 2010   Views: 13,283   Rating: 4.79/5    Votes: 12   Popularity: 5.19
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Bad formatting will delay the approval of your articles. Follow these basic rules to avoid that delay.
Scrapbook
General
Posted: 26 Jan 2010   Updated: 22 May 2010   Views: 13,964   Rating: 4.95/5    Votes: 21   Popularity: 6.55
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
Humor - Things to consider when your're out and about when the world starts to come to an end.
Posted: 23 Jan 2015   Updated: 23 Jan 2015   Views: 7,443   Rating: 4.82/5    Votes: 5   Popularity: 3.37
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
Some things to be aware of.
No reference articles have been posted.

John Simmons / outlaw programmer
Software Developer (Senior) Paddedwall Software
United States United States
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.

My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 28 May 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid