How to find path

S

Shimon Sim

I have web project that includes few sits that must share some pictures. The
project has following structure

Root - just a folder with solution files - this is on IIS regular folder
Site 1 - web application 1 (has asp.net project here) - site saves and
views the pictures
Site 2 - web application 2 (has asp.net project here) - just views the
pictures
SharedPicture - folder with shared pictures

It will be deployed in the same manner just root will be the root of the web
site.

The problem I have is to get this Shared Pictures folder that is outside of
the applications.
Server.MapPath("~") - returns root of the application (this could be done
with few other ways). I can get physical path by using Directory.GetParent.
It should be good enough for saving pictures but in order to read them I
need to get virtual path and that I have issue with - can't map system
directory to virtual path.

I could create entry in config file and type the directory name but I would
prefer to have it defined as "folder on the same level as application roots"
and find it dynamically.
I hope it is clear.
Thanks,
Shimon
 
K

Kevin Spencer

I think your best bet in terms of performance would be to put the path into
the web.config file. Anything above Application Root would require
inter-process communications.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
 
B

Bruce Barker

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top