Messing about with VirtualPaths

I know a lot of coders who love the System.IO.Path class. For those that don’t know about it, the class has lots of handy functions for dealing with paths from combining them to getting folder or file names from them. All these coders used to hate it when it came to web programming or any work with urls where they were unable to use the path class as thery had to deal with web addresses or "virtual paths".

The good news is that .Net 2 has the System.Web.VirtualPathUtility class which aims to be just and useful to web site developers as the Path class is to winforms and service developers. It has handy functions for getting relative paths from one virtual path to another or making them app relative etc.

Definitely worthing checking out if you are wrtiting code to handle re-directs or resource urls etc.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s