The VB group is one of the only groups which is not meeting in the Microsoft offices. They get together in the New Horizons training center off of LaVista Road. Tonight’s meeting had a smaller group than usual. I’m assuming everyone is as busy as I am recently at work and just can’t spare the time. I know that we’re not talking about a lack of advertising – Brendon and I have been getting up in front of every single user group announcing all the upcoming meetings for the month. But I’m not discouraged by low turnout – quite the opposite. Every group has been experiencing record-breaking turnout recently.
Tonight’s meeting had three speakers scheduled but only two managed to turn out. And of the two that turned out, only one really had a presentation ready for display. That completely disorganized, unprepared presenter was me! But that’s a different story for a different day.
I was signed up to talk about the FileSystemObject how it differs from the System.IO namespace. The gist of my presentation was this – the FileSystemObject is actually part of the Windows Scripting Host. This is useful because it means that you can use the FileSystemObject outside of .Net applications. I showed an example of a VBScript file and a JavaScript program, both using the FileSystemObject to work with disks, directories, and files. The System.IO namespace offers more power and flexibility than the FSO does. For example, with the System.IO namespace you can get the extension of a file with the .GetExtension method. With the FSO you’ll have to search the file name string for the ‘.’ I didn’t have time to get a proper VB.Net sample project ready for everyone to see, so Jim came to my rescue. He had an application he uses to read in some bizarre custom format text files. He showed us how he could do the job with the FSO, a System.IO StreamReader, and a System.IO FileStream. We didn’t have a good way to measure performance, but the general feeling of the group is that the System.IO namespace would be faster than the FSO. If for no other reason, the FSO seems to require a COM Interop layer. For those of you who might be interested in how to use the FileSystemObject in JavaScript or VBScript, check out DevGuru.com – they have the entire object model of both scripting languages and more. Also, you should take a look at the Scriptomatic.
Brendon was the second speaker, presenting an interesting technique he found on the web to add custom properties to an enumeration. For example, he was able to create an enumeration of integers which had associated descriptions. This could be really valuable in cases like binary bit masking or error codes. With this technique you can have a meaningful description associated with otherwise bizarre enumeration values. I don’t have any links for examples of Brendon’s code yet, but he’ll be putting them up on the VB.Net site soon enough.
After the meeting we made our traditional pilgrimage to Chili’s for some food, drink, and talk.
— Matt Ranlett