Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends,


i have developed a code which is given a image retriving , in this while execution image are retrived and executed , but when i created a setup file and installs i does'nt shows the image .
getting error this file is not exist.

please suggest me , how to give the absolute path in this project.
thanks in advance.


C#
string path = (@"../PatientsPhotos/" + this.patientid + ".jpg");



               if (File.Exists(path))
               {
                   ImageSource imageSource = (ImageSource)imgConv.ConvertFromString(path);
                   imgVideo.Source = imageSource;
               }
               else
               {

                   file doesn't exist;
               }
Posted

To convert virtual path to absolute (physical) path you need to use MapPath method[^]
 
Share this answer
 
Try:
C#
string path = @"../PatientsPhotos/" + this.patientid + ".jpg";
string fullPath = Path.GetFullPath(path);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900