Tuesday 3 June 2008

Using TextFieldParser objects and the My library in C# code

I read this article on InfoQ (a great site for information for those that don't know it) and saw that there might be some confusion about whether this useful class could be used in C# projects. The answer of course is yes. Just reference the Microsoft.VisualBasic dll in your project and away you go.

The My library is a little different it does a whole bunch of different things, providing both new methods, and a simplified model for accessing things that are both in the framework and that are specific to the project being worked in. For the new methods reflecting on the Microsoft.VisualBasic assembly soon uncovers these, and from there they can then just be referenced as above (or fronted with a simple facade if you prefer - perhaps extension methods FileInfo.OpenTextFieldParser() anyone). For the simplified navigation of the framework, and project, feature I don't know how that can be done in C#, but why would you want to? You know the framework anyway, right?

No comments: