将图像复制到资源文件夹..或任何特定的文件夹. [英] Copy Image to Resource Folder..or any Specific Folder.

查看:58
本文介绍了将图像复制到资源文件夹..或任何特定的文件夹.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有问题...我正在开发需要使用图像的软件.
我想通过编程将所有图像复制到 solution(Project)资源 images 文件夹中,然后保存新路径进入数据库.
所以请...请帮助我

Hello
I have a problem... i am developing a software where i need to use images.
and i want to copy all images to resource or images folder of solution(Project) through programming.And then I want to save the new Path into Database.
So pleas...pleas Help Me

推荐答案

不,不,你不想这样做.

我不确定您实际上要做什么-我对您的应用程序一无所知-但您确实不希望您的应用程序在运行时自行修改.并将项目添加到解决方案文件夹实际上就是了.

发布程序时会发生什么?那么解决方案文件夹在哪里?您是否打算在每次安装时发布源代码(以及VS的副本)?

而是将这些图像保留在ApplicationData文件夹中,或者(最好还是将它们直接放入数据库中.)
No, no you don''t want to do that.

I''m not sure what you do actually want to do - I have no idea of your application - but you really don''t want you app to modify itself when it is running. And adding items to the solution folders is effectively that.

What happens when you release the program? Where is the solution folder then? Are you going to release the source code (and a copy of VS) with each installation?

Instead, keep these images in your ApplicationData folder, or (better still) put them directly into your database.


在复制图像之前,您需要知道文件夹的路径.然后,您可以只使用File.Copy(sourceFileName, destFileName)传送图像.我个人喜欢使用应用程序设置"文件来保存资源路径之类的内容.这样,您只需在安装时设置资源文件夹,然后将路径保存到设置"文件中即可.将路径保存到数据库中与使用ADO.Net
保存任何字符串,varchar字段相同. 希望这会有所帮助.
You need to know the path of the folder before you can copy the images across. Then you can just use File.Copy(sourceFileName, destFileName) to transfer the images. Personally I like to use the Application Settings file to hold things such as resource paths. That way you can just set up a resource folder at setup and save the path into the Settings file. To save the path into a database is the same as saving any string, varchar field using ADO.Net
Hope this helps.


这篇关于将图像复制到资源文件夹..或任何特定的文件夹.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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