#include <iostream>
using namespace std;

#include <windows.h>
#include <AtlBase.h>
#include <AtlConv.h>

int main()
{
	const char from[100] = "F:\\桌面\\test\\新建文本文档.txt";
	char to[100] = "D:\\test.txt";
	USES_CONVERSION;
	LPCWSTR pFrom = A2CW(from);
	LPCWSTR pTo = A2CW(to);
	CopyFile(pFrom, pTo, 1);

	return 0;
}

  该程序调用windows API实现文件拷贝

posted on 2011-09-10 18:45  吃吃户  阅读(382)  评论(0编辑  收藏  举报