0
        Uri uri = new Uri("" + metric.Image, UriKind.Absolute);

        ImageSource imgSource = new BitmapImage(uri);

        ImageMetric.Source = imgSource;

我有这个代码

在数据库中,我将图像保存在路径 /UploadedImages/greenarrow.png 下

UploadedImages 和我的解决方案文件夹放在 E 盘。

但不同的文件夹。

如何访问它?

请帮我

4

1 回答 1

0

我终于找到了答案

当您在 iis 中托管网站时,您可以在其中创建一个图像文件夹并保存数据库中的图像

以便您可以浏览链接并找到图像。

Uri uri = new Uri(" http://www.abc.com "+fieldname.Image , UriKind.RelativeOrAbsolute); ImageSource imgSource = new BitmapImage(uri); ImageMetric.Source = imgSource;

于 2013-02-20T06:34:31.610 回答