在带有C#项目的ASP.net中,我想显示一张图片 [英] In ASP.net with C# project I want to display a picture

查看:333
本文介绍了在带有C#项目的ASP.net中,我想显示一张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由ASP.Net用C#开发的项目。我想在选择Emp时显示Employee Pic。我已将图片存储到不同的驱动器中。它不在项目中。

我该怎么做?



如果图片在Project image文件夹中,我很容易显示图片。当图片在本地驱动器中时,我无法显示图片。

解决方案

如果您有图片的路径(例如,如果您存储图片路径以及数据库中的其他员工详细信息)然后您的任务很简单,请参阅:如何在位图中加载具有相对路径的图像 [ ^ ]。


http://www.aspsnippets.com/Articles/Displaying-images-that-are-stored-outside-the -Website-Root-Folder.aspx [ ^ ]

I have a project which is develop by ASP.Net with C#. I want to show Employee Pic when i select a Emp. I have stored the pic to a different drive. it is not in project.
How can i do this?

If the picture is in Project image folder its easy for me to display the picture. When the picture is in a local drive the i could not display the picture.

解决方案

If you have the path of the picture (for instance, if you store the image path together with other employee details in your database) then your task is simple, see: "how to load image with relative path in bitmap"[^].


http://www.aspsnippets.com/Articles/Displaying-images-that-are-stored-outside-the-Website-Root-Folder.aspx[^]


这篇关于在带有C#项目的ASP.net中,我想显示一张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆