请,我需要本机代码来复制目录,子目录,子子目录等及其文件内容的给定系统. [英] please, I need native code for copying a given sytem of directories,subdirectories, subsubdirectories etc and their file content.

查看:48
本文介绍了请,我需要本机代码来复制目录,子目录,子子目录等及其文件内容的给定系统.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请,我需要本机代码来复制目录,子目录,子子目录等及其文件内容的给定系统.

please, I need native code for copying a given sytem of directories,subdirectories, subsubdirectories etc and their file content.

推荐答案

您是否使用Google查找了解决方案?
这是一个很好的链接,可以帮助您:
http://www.cplusplus.happycodings.com/Algorithms/code38.html [ ^ ]
这是一些示例代码:
Did you use Google to find a solution?
Here is a nice links that will help you:
http://www.cplusplus.happycodings.com/Algorithms/code38.html[^]
And here is some sample code:
    #include <windows.h>
#include <iostream>
using namespace std;
int main()
{
    SHFILEOPSTRUCT sf;
    memset(&sf,0,sizeof(sf));
    sf.hwnd = 0;
    sf.wFunc = FO_COPY;
    sf.pFrom = "d:\\masm32\\*.*";
    sf.pTo = "d:\\masm33";
    sf.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI;
    int n = SHFileOperation(&sf);
    if( n == 0)
    {
      cout << "Success\n";
    }
    else
    {
      cout << "Failed\n";
    }
}


使用ShellExecute: http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx [
Use ShellExecute : http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx[^]

With a command like :
xcopy.exe /s /q /y srcdir destdir


这篇关于请,我需要本机代码来复制目录,子目录,子子目录等及其文件内容的给定系统.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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