ykapase
ykapase

Reputation: 53

Images from common project

I have 4 projects in same solution. In one project the images get uploaded & stored in some folder.Now I want to show this image in another project which is in same solution.What code should I write in C#?

Upvotes: 0

Views: 161

Answers (2)

Sonal Satpute
Sonal Satpute

Reputation: 498

You can keep the ImageFolder path in config file in all the project.

And that path can be use to Read/Write the image(s).

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1499770

It seems to me that it would be sensible that the same project responsible for storing the images should be responsible for retrieving them too... either by providing a filename "mapping" service (e.g. original upload filename mapped to physical location on disc) or by giving a method which will open the file and return a Stream to the data. Then showing the image becomes a matter of calling that method and then loading the image as normal.

It's hard to be more precise without more details of what you're trying to do, how the image is stored etc. What have you already tried, and what problems have you run into?

Upvotes: 3

Related Questions