VBScript hashtable
Tuesday, 30 August 2005
For quite some time now, the more vigilant Windows IIS administrators have typically been configuring their hosts to have the “filesystem object” removed, due to an inherent security flaw which permits a malicious user to gain access to the servers directories and files.
Sadly, this removes the “dictionary object” as well, as both of the object libraries are stored in the same (scrrun.dll) file. For any ASP developer who has also worked with PHP or Perl, this is a bit of a bummer because the dictionary object, while not as powerful as PHP associative arrays or Perl hashes, is conceptually very similar, and therefore an indispensable part of the developers arsenal.
For those new to the topic, I won’t go into detail about the many benefits of associative arrays except to say that once you’ve coded with them, it’s really primitive to attempt any data structure handling without them.
That’s why we decided to roll our own. Our “hashtable class” is in every respect a clone of the intrinsic Windows dictionary object, without the inherent security vulnerability. In terms of implementation, it’s identical in every way. Download the class and use it on your current and future ASP projects that require VBScript.
|