2013-02-19 66 views
0
 Uri uri = new Uri("" + metric.Image, UriKind.Absolute); 

     ImageSource imgSource = new BitmapImage(uri); 

     ImageMetric.Source = imgSource; 

我有下路徑保存圖像此代碼訪問圖像

在數據庫IM /UploadedImages/greenarrow.png

UploadedImages和我的溶液夾置於E盤。

但是不同的文件夾。

如何訪問它?

請幫我

回答

0

我終於找到了答案

,而你正在主持在IIS中的網站,你可以在其中創建一個圖像文件夾,並從數據庫中保存圖像

,讓你可以瀏覽鏈接並找到圖像。

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