如何上传图片数据类型并保存在数据库或任何其他文档中,以及如何查看保存的图片 [英] How to upload a picture data type and save in either a database or any other doc and viewing the saved picture back

查看:82
本文介绍了如何上传图片数据类型并保存在数据库或任何其他文档中,以及如何查看保存的图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我们的办公室公开申请,员工数据中将包含要上传的他们的照片(护照照片),行政长官可能希望查看显示已保存护照的员工详细信息.
我想查看以下C#代码:上传,保存和显示图片.
谢谢.
Regads.
M.A. Busu

I am deveolping an application for our office, and in the employee data will include their picture(Passport Photograph)to be uploaded and the Asministrator may want to view the emloyee details showing the saved passport.
I want to see the C# code for:Uploading, Saving and displaying the Picture.
thanks.
Regads.
M.A. Busu

推荐答案

这应该是一个起点

如何使用Visual C#.NET将文件上传到ASP.NET中的Web服务器 [
This should be a starting point

How to upload a file to a Web server in ASP.NET by using Visual C# .NET[^]


在我看来,您正在谈论winforms .
看看本文的开头:
C#相册查看器 [
Looks to me you are talking of winforms.
Have a look at this article to start of: C# Photo Album Viewer[^]


我会设计一个数据库保存员工数据.对于图片,只需在数据库中添加一个字段即可将路径和文件名保存到图片中.然后将图片框绑定到该字段

数据库示例
----------------------------------
姓名:john doe
DOB:04/04/04
地址:等等等等
prof_pic:〜/picturepath/1.jpg
--------------------------

form_load事件
{

pictureBox.imageUrl = prof_pic

}
i would design a database that holds employee data. and for the the picture just add a field in the database that saves the path & filename to the picture. then bind a picturebox to that field

Database example
----------------------------------
Name: john doe
DOB: 04/04/04
address: blah blah
prof_pic: ~/picturepath/1.jpg
--------------------------

form_load event
{

pictureBox.imageUrl = prof_pic

}


这篇关于如何上传图片数据类型并保存在数据库或任何其他文档中,以及如何查看保存的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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