hi,
[I'm not quite sure where best to post this, as the question spans the IIS /
Asp.Net and the "scripting" or Console Application sides of the universe.
hope these 2 locations are appropriate.]
an Asp.Net page/script writes pictures to an "image cache", which is a
virtual directory, say "m" mapped to a real physical directory (or network
share), say c:\temp or ServerX : X$ \ media. this works fine. now, however,
i want to write a console application, scheduled to run once an hour, say,
which deletes pictures (files in the physical directory) older than, say, 4
hours.
this is all no problem. however, i'd like my machine.config application
settings to include the name of the virtual directory (so web and console
apps can both find it). web apps have no trouble mapping VirDir m to the
physical directory, but is there a way for a console application to do it?
(i have looked and googled, but not found what I need.)
is this a dumb idea? i'd rather not have to write the physical directory
name in machine.config (it varies wildly from developer machine to live
machine and can depend on other things too). i'd prefer all these machines
agreed on "m" and different places keep their physical locations (in their
IIS admin) where they want them.
i can write a web page to do this and then call it via http, but that seems
more than a bit klunky.
should i be thinking in terms of IIS administration scripting or the like?
(i have looked, but haven't yet found a good fit.) are there DotNet/C# tools
for scripting IIS6? (have looked...)
NB:
iisvdir /query mySite
is quite handy and delivers, among other things, the info I need. (so an
object that returned me the same information, say as a
dictionary<string,string> (VirDir mapping to PhysDir) would be great!)
i'd be grateful for any pointers.
cheers,
Tim Hanson