将映像名称从目录存储到数据库中 [英] store image name into database from directory

查看:113
本文介绍了将映像名称从目录存储到数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有多个包含图像的目录。我想将所有图像的图像名称存储到数据库中。任何帮助将不胜感激。谢谢。



我的目标名称如下:



dir1 -----包含图片

dir2 -----包含图片

dir3 -----包含图片

dir4 -----包含图片

dir5 -----包含图片









dir99 -----包含图片

i have multiple directories in my application which contains images. I want to store the image names of all the images into database. Any help will be appreciated. Thanks.

My direcotry names are in a pattern like below :

dir1 ----- contains images
dir2 ----- contains images
dir3 ----- contains images
dir4 ----- contains images
dir5 ----- contains images
.
.
.
.
dir99 ----- contains images

推荐答案

其实先生我不知道.. :(



所以...你从头开始。

我们不做你的功课,所以它会去要由你自己做。

但我们会帮助指导你完成。



从查看任务开始分为两部分:

1)数据收集

2)数据存储



第一部分是相对简单:

您需要找到所有文件夹 - Directory.GetDirectories可能会有所帮助 - 然后找到文件 - Directory.GetFile这次。



第二个更难,因为它涉及到您的数据库。

首先考虑你通常如何插入到aDB和它从那里开始。



试一试,让我知道你能走多远。
"Actually sir i dont have any idea.. :( "

So... You start from the beginning.
We don't do your homework, so it's going to be up to you to do this yourself.
But we'll help guide you through.

Start by looking at the task and breaking it into two parts:
1) Data collection
2) Data storage

The first part is relatively trivial:
You need to find all the folders - Directory.GetDirectories may help - and then find the files - Directory.GetFiles this time.

The second is harder, because it involves taking to your DB.
Start by thinking about how you normally INSERT to aDB and it from there.

Give it a try, and let me know how far you get.


这篇关于将映像名称从目录存储到数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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