Well I’ve been meaning to try out a blogging tool out for ages but just haven’t got round to it. So I’m going to try out the tool on a ‘trial-basis’ to see if I like it!
So here goes…
Well I’ve been meaning to try out a blogging tool out for ages but just haven’t got round to it. So I’m going to try out the tool on a ‘trial-basis’ to see if I like it!
So here goes…
I tried a new method call today on ASP.NET MembershipUser.
Dim thisUser As MembershipUser = Membership.GetUser(thisUserName)
Then I called the following:
lbl.Text = thisUser.GetPassword
and got the following exception:
This Membership Provider has not been configured to support password retrieval.
After some investigation I noticed I needed the following in my web.config (Notice those in RED are the attributes that are required and were added in order to support the GetPassword method):
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
connectionStringName="247Db"
minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider"
applicationName="/247App"
enablePasswordRetrieval="true"
requiresQuestionAndAnswer="false"
passwordFormat="Encrypted"
requiresUniqueEmail="false" />
</providers>
</membership>
Following these additions, you need to add the following to web.config. There is a automatic key generator at the following: machineKey Generator
<machineKey validationKey="11D7D8362528F04266ACACDDEA7..."
decryptionKey="4C0..."
validation="SHA1"/>
You should then be able to support the GetPassword method().
If you don’t add the machineKey then you’ll get a different error as follows:
You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.
Nice error hey? This is part & parcel of understanding a lot of the ASP.NET membership framework, you fix something somewhere, and you end up with a different error somewhere else. Its a big learning curve but a worthwhile one at that!
I came across a situation today where I wanted to change usernames of a set of users within my web app. I created a list of around 20-30 administrative users all with usernames based on the location of their office. However, I’ve now been advised that these usernames would be better stored as 2 letters. This would certainly make login easier for the administrative users, but I now have the task of either deleting them all and starting again or finding some other way of renaming the usernames.
After a quick google, I’ve noticed there is no quick way of doing this apart from this method described here:
Maybe this will be something that will be added in future versions of ASP.NET?!
Today, I had to go through all the usernames and change them, and all I ended up doing was using the Database editor (in t his case myLittleAdmin) provided by my web hosting company.
It was as simple as clicking on the aspnet_Users table and then modifying each row, in particular the UserName and LoweredUserName fields. You could even create some SQL to go and update each row based on some other piece of data perhaps?
I’ve been thinking recently about starting my own little web development project away from work and I’ve had several ideas, one of which one is an online mp3 tagger. Now I realise that for quite a while there has been the CDDB application from GraceNote which recognises a CD from the CD’s unique ID. Basically it carries out a check on their own database over the Internet.
Recently I’ve noticed that within my own mp3 library I have hundreds of ‘orphaned’ mp3s, with no mp3 tag information within my digital library. No track information on the mp3. Most of the time mp3s have their track information included because they have that information included when downloaded from a mp3 site or when an album is ripped. My problem has been due to ripping my own CD compliations, or albums that haven’t been recognised by CDDB when they have been ripped.
I thought, what if I could develop my own software which takes a checksum of the first few bytes of the song and compares it to a database? Surely that would be a unique way of identifying an mp3 song? Two problems, first by designing my own recognition s/w I would have to ensure I also maintain a massive database of tracks & information along with their unique IDs. Not the ideal situation!
After some investigation I realised that a few companies have already done this using acousting fingerprinting. They use an algorithm which generates a unique ID for an mp3 or other audio track which isn’t effected by the quality of the track (since mp3’s come in a variety of different formats).
One organisation which might provide enough of the cogs to get this idea going is MusicBrainz. They already provide a few tools which allow recognition of mp3 tracks. They also use this acoustic fingerprinting technique so their s/w no doubt would be much more reliable at detecting different mp3 tracks than anything I write!! Also, they have an online database of music which is constantly being updated including editors of the BBC.
My idea would basically be to provide the same thing as their downloadable mp3 tag repairing applications, but provide this through a web front-end. Basically you just feed in your orphaned mp3 track and it squirts it back at you complete with the tag information included!