Server.MapPath FileNotFound problem

A

Aahz

Hello, I have a problem with Server.MapPath founding file

I have huge project in virtual directory "Proj" located in
"My Documents/Proj" and all my project files are there.

Now I need to use a "picture.png" located in "Proj/pictures" directory.
Code is:
Image img= Bitmap.FromFile(Server.MapPath("pictures/picture.png"));

.... and problem is that my application crashes and in Exception Details
is see that picture is looked for in
"c:\inetpub\wwwroot\pictures\picture.png" ,
instead in "Proj/pictures"

I tried several version of path, ie: (../pict.., ..\pictures\pic.,
\pictures, @(\pictures.. )
and nothing worked !

Anyone see any solution please ??
Thanks;
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top