Project Description
In contrast to other projects it is custom control (not .ascx control - differences: http://support.microsoft.com/kb/893667) and images are generated on the fly. My project is very similar to http://captcha.codeplex.com/, which is rewritten in C# version of project created by Jeff Atwood in VB (see http://www.codeproject.com/KB/custom-controls/CaptchaControl.aspx). Differences include:

  • I didn't used mentioned code - my translation has many readability improvements,
  • original Jeff's code has 2 bugs:
    • problems with Session (CacheStrategy) - that was solved (by using IRequiresSessionState) in LaptopHeaven's port,
    • problem when user set font family name that does not exists on server - I solved this issue,
  • new features:
    • added localization (via .resx files),
    • added RequiredFieldValidator on text input (integrates with ValidationSummary and prevents from unnecessary postbacks), by the way this feature appears as patch in LaptopHeaven's port, but it is far from ideal.

I put emphasis on code quality (StyleCop and CodeAnalysis). Of course, I didn't comment obvious things :). Project in VS 2010, but targeted to ASP.NET 2.0.

Screenshots
control

properties

Blog/Contact
In polish: http://mchodyla.studentlive.pl/blog/

Partially trusted environment/IIS 7

In order to use this assembly in partially trusted environment (less then Full/Unlimited trust policy) add AllowPartiallyTrustedCallersAttribute in AssemblyInfo.cs:

[assembly:AllowPartiallyTrustedCallers]

When using IIS 7 also add handler in system.webServer section:

<configuration>

  <system.webServer>
    <handlers>
      <add name="CaptchaHandler" verb="GET" path="CaptchaImage.aspx" type="CustomCaptcha.CaptchaImageHandler, CustomCaptcha" />
    </handlers>
  </system.webServer>

</configuration>

 

Last edited Apr 2, 2011 at 11:14 AM by mchodyla, version 3