Ken,
Friendly name has the virtual root name embedded, but not the application
name that you can give via the IIS Manager. For example, here's my IIS
Application Name set in IIS: MyTestVBWebApp. The virtual directory is
called TestVBWebApp. I made them different to make sure I was getting the
value that I set in IIS, and not just the name of the virtual directory.
Anyway, the FriendlyName property comes out to be:
/LM/w3svc/1/root/TestVBWeb App-3-127252855483045295.
I think I have to look outside of the AppDomain class because of the way
ASP.NET sets these up dynamically (multiple ASP.NET web apps can be inside
the same App Domain). I'm looking for something that reflects on the IIS
settings for the current ASP.NET web app.
I also worry about going straight against the metabase because it might not
work across IIS5/IIS6 platforms, but I'll see what I can do.
Thoughts??
--
Doug Thews
Director, Customer Solutions
D&D Consulting Services
----------------
Visit my Tech Blog at:
http://www.ddconsult.com/blogs/illuminati/
Ken Cox said:
Hi Doug,
The name seems to be embedded in the FriendlyName property. Not sure if you
can parse it out.
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
Label1.Text = currentDomain.FriendlyName
Also, there seems to be a way to get this kind of info from the metabase.
You might want to look here for ideas:
http://www.iisfaq.com/default.aspx?View=A540&P=199
Ken
MVP [ASP.NET]