安装时如何复制文件夹 [英] How to copy a folder upon install

查看:125
本文介绍了安装时如何复制文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究应用程序的最后一部分,但是在发布它之前,我需要知道如何将包含.exe和.txt文件的文件夹复制到用户的C:驱动器安装后,将与应用程序一起使用.我需要将文件夹与其他应用程序数据一起复制到C :,而不是C:/Program Files.类似于Photoshop如何在documents文件夹中为您的项目文件创建PSD文件夹.这可能吗?请帮忙!

I''m working on the final part of my application, but before I can publish it, I need to know how to copy a folder containing a .exe and a .txt file to the user''s C: Drive upon installation, to be used with the application. I need the folder to be copied to C:, not C:/Program Files with the rest of the app data. Something similar to how Photoshop creates a PSD folder for your project files in the documents folder. Is this possible? Please help!

推荐答案

您可以使用System.IO.Directory.Copy命令复制文件夹.但是直接写入根文件夹不是一个好主意.

您要复制到根文件夹C:的任何原因?除非您是管理员,否则Windows 7不允许您将文件复制到根文件夹.您可能需要重新考虑设计.
You can use System.IO.Directory.Copy command to copy the folders. But it is not a good idea to write the the root folder directly.

Any reasons you want to copy to the root folder C: ? Windows 7 does not allow you to copy files to the root folder unless you are an administrator. You may have to reconsider your design.


这篇关于安装时如何复制文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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