商店和使用C#从特定文件夹中检索图像 [英] Store & Retrieve images from a specific folder using C#
本文介绍了商店和使用C#从特定文件夹中检索图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用C#和sql server 2005开发了HR软件.我必须将员工映像存储在服务器的特定文件夹中而不是数据库中,然后从特定文件夹中读取它,说"C:\ EmpImages".如果有人可以帮助我,我将不胜感激.在此先感谢您.
Iam devloping a HR Software using C# and sql server 2005. I have to store employee images on a specific folder of the server not on the database and then read it from the specific folder say "C:\EmpImages". I will be grateful If anyone can help me. Thanks in advance.
推荐答案
尝试以下代码从系统上的任何位置访问图像:
Try following code to access image from a any location on your system:
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
{
OpenFileDialog ofDlg = new OpenFileDialog();
ofDlg.Filter = "Image files (.jpg, .jpeg, .bmp, .gif)|*.jpg;*.jpeg;*.bmp;*.gif";
if (ofDlg.ShowDialog() == DialogResult.OK)
{
imageFileName = ofDlg.FileName; // This imagepath shall be used to store in members table
pictureBox1.Image = Image.FromFile(imageFileName);
}
}
希望对您有帮助.
Hope this will help you.
当用户ID与来自驱动器和显示器的图像名称拾取匹配时,使用特定的ID保存图像.
问候.,
shefeek
Hi,
save the images using a specific id,when the users id is matching with the imagename pickout that from the drive and display.
regards.,
shefeek
这可能对您有帮助,
Image.Save [ Image.FromFile [
It might help you,
Image.Save[^]
Image.FromFile[^]
:)
这篇关于商店和使用C#从特定文件夹中检索图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文