I have a minor problem with a C# web app. I am trying to retrieve just the application name that an exception has occured. Basically when you retrieve the application path it comes up as the whole path. I need this broken up where just the application name appears.

D:\Inetpub\wwwroot\AppError

I just want AppError to appear. The problem is this has to dynamically do this because it might not be a web application sometimes.

Thanks in advance,
Pol