Putting an intranet live using Windows SharePoint Services (WSS) was probably one of the better ideas I had last year, however there is one thing that over time has become more and more annoying and that is the username and password prompt that is always displayed when opening a document (whether it is Word, Excel, Publisher or PowerPoint) in either read only or edit mode.

After being grumbled at for the 100th time this week, I thought it was about time that I got to the bottom of it - I had tried before, but nothing seemed to make a difference and it wasn't that high on the priority list.

It would appear that the WebClient/WinHTTP service ignores the security zone settings within IE which would explain why previous solutions I've read on this problem never seemed to work for me (they all revolved around making changes to the IE configuration), well unless you wanted to make IE exceptionally insecure that is...

It's worth noting that the registry changes still worked even though the machines were running Vista SP1 and some of the file dates/versions were lower than those listed within the article.

Oh... don't forget to restart the WebClient service (I missed that first time around)...

In fact I was seeing < 100MB physical memory available and the page file usage at approximately 9-10GB on a server that currently has 4GB of RAM and that isn't normally stressed at all.

As this server hosts a number of Web sites in seperate application pools firing up Task Manager revealed some interesting results. I could see most application pools consuming 8-10MB of RAM each, some consuming 30-40MB, but quite a few consuming > 100MB with a couple consuming over 150MB.

I started to tie the application pools back to the individual Web sites and look at the type of content that they were serving, whether it was static or dynamic, ASP, ASP.NET or PHP, whether they were using Access, MySQL or SQL Server databases and whether they were typically busy Web sites.

One thing became immediately apparent, the memory boozers were all ASP driven...

My initial reaction was to stop all McAfee services (always blame the anti-virus software first!) and to see what happened, so after doing this and a quick iisreset I fired up Task Manager again and waited... Sure enough 10 minutes later I was seeing application pools running at > 100MB.

So, thinking that the AV software wasn't to blame I spent the next hour or so checking everything else I could think of.

In the end I turned to the IIS Diagnostics Toolkit (if you haven't seen this check it out!) and dumped a couple of the w3wp.exe processes, within a couple of minutes I was staring at a report which quite obviously was pointing the finger at one of the McAfee modules that was utilising 120MB of the process. After repeating this on a few other processes, all with similar results, I then had to set about working out which part of McAfee was to "blame".

Eventually this led me to the ScriptScan setting within McAfee VirusScan, which is described as...

"ScriptScan scans JavaScript and VBScript scripts that are executed by the Windows Scripting Host. WSH is used by Internet Explorer and Outlook. If an unwanted script is detected it is not allowed to execute."

Hmmm...

So a quick disable (well, actually not that quick as the AV policies are centrally managed and have to be propogated down to server level from a management console), an iisreset later and I'm closely watching Task Manager as the application pools start firing up... 10 minutes later I'm still watching... 15 minutes... time for a coffee... 30 minutes later and I'm seeing no application pools above 100MB, the vast majority at 8-20MB and the rest at 30-40MB with a couple busier sites running at 50-60MB.

Available memory has suddenly increased from < 100MB to > 2.5GB and the page file usage is down to 2GB.

Re-enabling ScriptScan proves that this "feature" is the problem...

So why is a feature related to Windows Scripting Host, interfering with a process that is excluded from scanning, when the AV services are stopped?

Well, if I knew the answer to that I could probably predict lottery numbers...

Yes, I'm still around! - but I have been pretty busy at work over the last few months, however as FormShield and IIS 7 keeps coming up, I thought it was about time that I added a quick blog post!

The good news is that FormShield works fine with IIS 7, but you do need to make a configuration change...

You can either change the application pool that the Web site uses to the Classic .NET application pool or move the <httpHandlers> section under <system.web> of the web.config file to the new IIS 7 <handlers> section under <system.webServer>.

A few people have asked me recently how they actually donate for FormShield and I must admit it isn't exactly obvious. There is a PayPal button on the main FormShield article, but it is a bit buried!

So, for anyone who would like to donate, here is the link:

Once your donation is received I will drop you an e-mail with a license key that removes the 'dotNetFreak.co.uk' adverts.

This e-mail isn't sent automatically, and whilst I do endeavour to send them out the same day you donate, I'm not always able to do so, and on occasion it may take a couple of days before you receive your key!

Whilst writing the sound support for FormShield v2, I came across quite an interesting issue, well it was interesting once I'd found the answer, but up until then I wasn't in the best of moods.

Basically, FormShield uses the BinaryWrite() method to write an audio file to the requesting browser to provide sound support. The issue was that this worked fine in IE, Safari and Opera, but for some reason Firefox didn't seem to like it.

The strange thing about it was that it would play the first x number of characters, but then stop. On a Mac, it would only play the first character before giving up.

Thinking that it must be something to do with how I was writing the file out, or perhaps the file size, or even my code that builds the sound file, I started to pull the code apart.

A few hours later, I was no further forward.

I came to the conclusion that it couldn't be my code, after all, writing images out this way seemed to work fine in every browser.

So, I started to look around the problem. I then stumbled across an old post related to writing out PDF files on the fly using BinaryWrite and whilst the issue didn't see to be the same, or affect the same browser (they were talking about IE), one word was mentioned that rang a bell - "Compression".

I suddenly remembered that HTTP compression was enabled in IIS on this particular server - Quickly turning it off and running an 'iisreset' and testing resulted in a perfect playback.

Thankfully all of the code I changed was only a CTRL-Z away from being put back to how it was originally and 10 minutes later I retested it and it worked fine.

So, why does HTTP compression in IIS only break Firefox? No idea - After spending seven hours on the problem I really couldn't care.

One question I'm bound to be asked is why have I made FormShield v2.0 donationware rather than commercial and why haven't I continued to offer it for free.

Well, starting at the end first - FormShield is still totally free for personal and commercial use and you are still able to distribute it with your applications without 'donating' a penny (or dime), providing you don't charge for it of course!

Ok, so if it's free why the 'dotNetFreak.co.uk adverts'?

Well, when something is offered for free (or donationware), it's too easy to just take it, use it and forget about it. I've done it, you've done, everyone does it. By having a couple of 'gentle' reminders, it prompts us to think "Actually I do use this a lot more than I initially thought, I'm going to pay something for this". Of course that's the idea, whether it works or not is another matter!

If it doesn't, I should at least end up with more people using FormShield and hopefully some of them will donate!

Why donationware?

The idea behind making FormShield donationware is simple:

Some people have suggested it as they would like to contribute towards future development of FormShield and other controls.

FormShield is a complex control and because of this it has taken a large amount of time to create.

I don't get paid for doing this - in fact it actually costs me money!

I didn't want to restrict the overall functionality of FormShield.

Why not commercial?

The problem with making anything commercial is it removes it from the realm of being a hobby which is all my controls are at the end of day. Yes, they were initially written for other projects, but those projects didn't need me to write new versions. Also, I don't have time to support another commercial venture, I spend most of my time working as it is! I also hate writing documentation and examples, both of which I would need to do to make FormShield commercial.

I also didn't want to stop the smaller Web sites and hobbyists from using FormShield because they couldn't afford to pay the 'commercial' (per Web site in some cases) license fees.

Right, so it's totally free if I don't mind the occasional 'dotNetFreak.co.uk' advert?

Yep.

Are all of your existing controls and future controls moving to donationware?

No. Only FormShield, but if you want to send a donation for the others please feel free!

If I release future controls (quite likely as I'm starting a new project shortly which will probably require custom controls) they may or may not be donationware. More than likely the first versions won't be.

I want to donate - How much?

Firstly, thank you!

Secondly, whatever you want. Its not that I don't care how much you donate, I don't know your circumstances or how widely you use my controls. If you're working for a Web design agency and you use my controls on two hundred Web sites, perhaps you should be thinking more than the one guy who adds it to his blog, but at the end of the day it's entirely up to you, I'm just happy you're going to donate!

FormShield started out as a simple project with just one aim - to prevent automated form submission using dynamically generated images.

Not exactly a new idea - dynamically generated images requiring the user to enter the text found on the image have been around for quite a while, preventing automated sign-ups to free e-mail services such as HotMail and Yahoo, and automated whois lookups on domain names on sites such as Network Solutions.

Whilst some code exists on Code Project, there didn't however seem to be a free, easy-to-use and customisable control for ASP.NET with full designer integration that could generate the relevant images. So, looking for an excuse to delve into GDI+, FormShield was born and my idea of a 'simple' control was dropped...

... That was 2004 and this is now...

Version 2 of FormShield builds on the previous .NET 1.1 version, adding a wealth of new features, options and accessibility improvements. The most notable feature addition is the capability for FormShield to now automatically generate a spoken version of the value shown on the image to aid with accessibility legal compliance. This however is just one of a handful of major new features, not to mention the number of improvements and changes made since the previous version.

However, whilst a lot has changed, FormShield remains true to its original goals - to be 'easy-to-use', 'customisable' and to have 'full designer integration'.

No other .NET captcha control currently on the market has the number of features of FormShield, but more importantly, none of them are as customisable or have such a rich design-time experience when used in Visual Studio.

To get the image to appear when you first drag 'n' drop FormShield to your page, right click on the control and select both 'Add Secret Key' and 'Add HttpHandler', then save the file and right click on a blank space on the page and click 'Refresh'. If that doesn't work, hit the page in a Web browser and repeat the refresh process. You may also need to open, save and close the web.config file.

On occasion the image doesn't reflect property changes made within the property grid. This seems to be either an issue with Visual Studio, or caching. The easiest way to solve the problem (if it happens in the first place) is to save the file and to repeat the refresh process described above. If you are changing image design properties you can also try placing your mouse cursor into the relevant dropdown list and use the cursor keys to navigate through the options.

Usage:

Simply download, add to your toolbox, drag 'n' drop to your page and set the relevant properties using the property grid.

To combine with a validation control (e.g. StringCompareValidator), add the validation control as well as a TextBox to your page, set the StringCompareValidator's 'ControlToCompare' property to point to the FormShield control and the 'ControlToValidate' property to point to the TextBox control. You will also need to set 'EnableClientScript' to False on the validator if 'EncryptQueryString' is set to True on the FormShield control.

To change the HttpHandler name/path, update your web.config file and change the HttpHandlerPath property value to point to the new handler.

To specify your own secret key for encryption, add/change the 'formShield_SecretKey' AppSetting in the web.config file.

Licensing & Download:

FormShield v2 is released as 'Donationware', for more information, please click here.

However - You don't have to donate unless you want to - FormShield can still be used for free for both personal and commercial use, however it will periodically (about 10% of the time) render 'dotNetFreak.co.uk' as the image text and will play 'This control is provided by www.dotnetfreak.co.uk' before the text value when someone clicks on the sound icon (again, about 10% of the time).

If you do decide to donate (thank you!), you will be e-mailed a license key as soon as possible with instructions on how to add it to FormShield so that it removes the 'dotNetFreak.co.uk' adverts.

Whether you have donated or not, you may also redistribute the control royalty free, providing that you don't charge for it. Also, if you intend to distribute the control as part of an application which is publicly available it would be nice to know, although this isn't a requirement.

Got a good image design? Drop me a line using the contact link and I'll look to include it as a preset.