Derek Hatchard blogs on
Church Radius Blog


Feed Yourself:


Subscribe in Bloglines

Add to Google

Subscribe by Email:


.NET Experts on Tap
About ArdentDev.com
Ardent Sites
Ask the Experts
Careers
Consulting and Mentoring
Contact Ardent
News & Noteworthy
Portfolio
Writing


On this page....
ASP.NET Membership and passwordStrengthRegularExpression
Visual Studio 2005 Express Editions free until November 2006
Hope they pay well...
MIX 06 - are you going for the conversation?
Microsoft Anti-Spyware Cripples Norton AntiVirus
Final 3 Logos for ChurchRadius.com
Um, x-rates.com is for EXCHANGE RATES
How to check for a network connection in .NET 2.0 (C# or VB)
What does every Visual Basic developer need to know?
Riley the Blog Helper
Brain Teaser: What Does This JavaScript Do?
Tool I Love: JavaScript Debugger

Send mail to the authors Email Us

Archives

Navigation

Categories
 Code
 Tools

Disclaimer
The opinions expressed in this site are those of the individual authors and do not necessarily represent the official view of Ardent Development nor its employees, subsidiaries, partners, or customers.

© Copyright 2008, Ardent Development

Powered by: newtelligence dasBlog 1.8.5223.1



 Tuesday, March 21, 2006

   
     
Membership in the .NET framework 2.0 allows you to add security to your application with little to no code.

When trying to enforce strong password rules in our church software I encountered an interesting problem.

At first I modified the web.config by adding the following line to our membership provider section.

passwordStrengthRegularExpression="(?=.{8,})[a-z]+[^a-z]+|[^a-z]+[a-z]+"

RegEx explained: 8 characters or more in length, at least 1 lowercase letter, at least 1 character that is not a lower letter.

I removed:

minRequiredPasswordLength="0"
minRequiredNonalphanumericCharacters="1"

After some testing I found that even when following the password rules, a password change would fail.

The ChangePassword control, which is part of the Login suite of controls, doesn’t give you any information as to why the password changed failed.

After a few reviews of my RegEx and confirming that the syntax is correct in code and with some useful online regular expression testers (see links below), I tried changing the password using the following code:

MembershipUser mUser = Membership.GetUser(); // gets the current logged in user
//change the password
mUser.ChangePassword(mUser.GetPassword(), “invalidpassword”);

That caused the following exception: System.ArgumentException: Non alpha numeric characters in 'newPassword' needs to be greater than or equal to '1'.

So I added this line:

minRequiredNonalphanumericCharacters="0"

And our password complexity rule started working properly.

I won’t start a debate on the merit of setting the minimum required non alphanumeric characters (say that ten times) to 1, but hopefully this will help someone somewhere some time.

Links:

JavaScript Regular Expression Tester
http://www.roblocher.com/technotes/regexp.aspx

.NET Regular Expression Tester
http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx
Posted by Sebastien Aube 3/21/2006 4:28:48 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [8]  | 
 Monday, February 20, 2006

   
     

I didn't realize that the Express Editions of Visual Studio 2005 are only free until November 2006.

http://msdn.microsoft.com/vstudio/express/support/faq/default.aspx#pricing:

We originally announced pricing of Visual Studio Express at US$49. We are now offering Visual Studio Express for free, as a limited-in-time promotional offer, until November 6, 2006. Note that we are also offering SQL Server 2005 Express Edition as a free download, and that this offer is not limited to the same promotional pricing period as Visual Studio Express.

 

Posted by Derek Hatchard 2/20/2006 8:50:46 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Saturday, February 18, 2006

   
     

Keane Canada is looking for 20 Mainframe Programmer/Analysts in Halifax, Nova Scotia.  I hope they pay well because these jobs are, um, not terribly appealing:

Required Skills:

  • COBOL
  • JCL
  • DB2
  • Strong analysis skills
  • Strong communication skills
  • Independent Learner

Be part of a significant project maintaining software components based on specifications and test changes. Work hours will be early (8:00-5:00) & late (12:00-9:00) shifts with late shifts every other week (50% of the time).

COBOL and JCL with night shifts half the time.  Ugh.

Posted by Derek Hatchard 2/18/2006 9:35:36 AM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Friday, February 17, 2006

   
     

Are you going to MIX 06?  I really wish I could make it but too much is going on here to make room in my schedule.  Grrrr.  I'm going to regret not going to this conference.  It looks like some really interesting stuff is going to happen.  The one I most hope is available online (live or on-demand):

http://blog.mix06.com/blog/archive/2006/01/24/58.aspx:  Bill Gates in an unscripted conversation with Tim O'Reilly.  I love listening to Tim O'Reilly speak.  If you haven't heard him, check out some of the podcasts featuring him over at IT Conversations (http://www.google.com/custom?q=Tim+O%27Reilly&sitesearch=itconversations.com).

Posted by Derek Hatchard 2/17/2006 10:55:29 AM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Wednesday, February 15, 2006

   
     

It's all over the news sites this week, but in case you missed it:  a definition file update for the beta release of Microsoft Anti-Spyware incorrectly identified Norton AntiVirus as a password-stealing trojan virus.  Then again, not everyone thinks that calling Norton AV a virus is off-base:  http://it.slashdot.org/it/06/02/11/2259232.shtml.

Posted by Derek Hatchard 2/15/2006 9:27:07 AM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Friday, February 03, 2006

   
     

After a round of voting from a short list amongst friends and family, we have a final 3 set of logo options for our new church software.  We would really appreciate your comments on which logo you think is best.  Leave a comment below or send us some feedback at http://www.ardentdev.com/Feedback/.  Thanks!

Logo 1:

 

Logo 2:

 

Logo 3:

 

Posted by Derek Hatchard 2/3/2006 4:28:29 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [6]  | 
 Wednesday, January 25, 2006

   
     

I spoke at the Fredericton .NET User Group last night on Team System.  It went well - a lot of the stuff in Team System is fun to show and professional developers really resonate with it.

Well...  I use the Address toolbar in the Windows taskbar.  It just so happened that the last site I visited via that toolbar was www.x-rates.com, which is where I regularly check the current US to Canadian dollar exchange rate.  In the middle of my presentation I noticed the URL and it dawned on me that it might not be obvious to everyone that the site is, um, family friendly.  So if you were at the presentation and the noticed the URL, X is for exchange.

Posted by Derek Hatchard 1/25/2006 8:15:00 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Tuesday, January 17, 2006

   
     

To check for a network connection in .NET 2.0 use this:

System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()

To monitor a change in IP address or a change in network availability, use the events from the NetworkChange class:

System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged

System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged

Posted by Derek Hatchard 1/17/2006 9:15:15 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Friday, January 06, 2006

   
     

What are the .NET Framework and Visual Basic .NET features that every VB developer should know?  I suggest the following as a starting list (in no particular order):

  1. Object-oriented features:  classes, objects, constructors, inheritance, interfaces, polymorphism, methods, overloading
  2. Shared (static) Classes and Methods
  3. Converting data types and casting objects
  4. Manipulating strings and using StringBuilder
  5. Basic File I/O (open, read, write)
  6. ADO.NET:  DataSet, *DataAdapter, *Command, and *DataReader classes
  7. Basic XML processing (opening a file/stream and finding an element)
  8. Exception handling / Try-Catch blocks
  9. Difference between late binding and early binding (and the existence of Option Strict On)
  10. Assemblies, referencing DLLs, and importing namespaces
  11. Basic collections (lists, dictionaries, arrays)
  12. Security fundamentals (CAS, authentication vs. authorization, validating input)
  13. Basics of threading
  14. Basics of garbage collection
  15. Spitting out data and getting data back (varies with type of application of course)

Comment away!  Please don't just say C# (or Ruby)...  I'm not looking for yet another VB vs. C# debate.

Posted by Derek Hatchard 1/6/2006 3:41:18 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [4]  | 
 Thursday, January 05, 2006

   
     

Last month I was looking for a tool to automatically announce posts on www.ardentdev.com and www.2signals.com at my weblogs.asp.net blog.  After a modest amount of searching I gave up on finding a tool that did exactly what I wanted.  Tonight I just threw together something simple.  It uses the .Text Simple Blog Service and the RSS.NET Class Library (with a few minor tweaks).  I point the tool at an RSS feed and select the posts I want to announce.  There is a little preview of the announcement HTML and an easy-to-acquire Announce button.  It's pretty simple at this point (a mere 80 lines of VB code including whitespace).

I'll gladly share the code if anyone cares.

Code | Tools
Posted by Derek Hatchard 1/5/2006 12:05:40 AM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 Wednesday, January 04, 2006

   
     

JavaScript is one of those technologies that you can use for years knowing only very little about it.  Do you know what the following <script> block will do?  Post your guess as a comment before you test it out!

<script>

(function()
{
  function A() { document.write(A) }

  A();
})()

</script>

Posted by Derek Hatchard 1/4/2006 8:31:50 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [4]  | 
 Tuesday, December 13, 2005

   
     

A regular "feature" we will have here at the Ardent Dev Blog is a series of "Tool I Love / Tool I Hate" posts (kind of like the "What's On Your Hard Drive" column in Queue magazine).  A new addition to my tool set is the Venkam JavaScript Debugger for Mozilla.  The latest version as of this post was 0.9.85, which would not install for FireFox 1.5.  The XPI (add-on package) was hard-coded to a max version of 1.1.  Fortunately add-on packages for Mozilla are just Zip files that you can extract and hack pretty easily.  Here is how I got Venkman to install with FireFox 1.5:

  1. Downlowd Venkman 0.9.85.
  2. Change file extension to .zip and unzip.
  3. Open install.rdf with your favourite text editor.
  4. Find <em:maxVersion>1.1</em:maxVersion> and change the maxVersion to 1.5 (or any arbitrary number higher than 1.5 - it might or might not work on future releases of FireFox).
  5. Save your changes and close your text editor.
  6. Rezip the files and change the file extension from .zip to .xpi.
  7. Open the new XPI file in FireFox (using File | Open File menu or just drag-and-drop).

If you are a brave and trusting sort of individual, you can just download my modified XPI here: Modified venkman-0.9.85.xpi (209.03 KB).

Posted by Derek Hatchard 12/13/2005 3:06:55 PM (Atlantic Standard Time, UTC-04:00)
#   Disclaimer  |  Comments [0]  | 
 
© 2005 Ardent Development Solutions