You know you’re a geek when…

You get excited by classes like FileInfo. The FileInfo class in the .net framework appears to solve most of those annoying filename/path handling problems that always used to involve plenty of string manipulation and lots of dodgy assumptions.

You can create an object of the FileInfo class with a relative or absolute path and then ask it for the various parts of the file/path. If you give it a relative path it can still give you a sensible full path. It also allows you to do the standard stuff like check to see if the file exists. All in all very simple and useful.

FileInfo iniFile = new FileInfo("myprogram.ini");
    IniFile ini = new IniFile(iniFile.FullName);
   // read the ini file settings.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s