13日工作日记

来源:互联网 发布:sql注入防御技术 编辑:程序博客网 时间:2024/04/30 12:26

今天用到一个winAPI 

int SHFileOperation(LPSHFILEOPSTRUCT lpFileOp);
作用是复制,移动,重命名,删除文件,
其操作在结构体SHFILEOPSTRUCT中定义,支持多文件向多目标拷贝,注意下面你这句话
Each file name is terminated by a single NULL character("/0")。
The last file name is terminated with a double NULL character ("/0/0") to indicate the end of the buffer.
就是说多个文件名之间由/0分割,而结尾处以/0/0结尾
此处使用CString直接+="/0"是无效的(+=在目标字串的/0处终止),只能通过char×循环操作来实现
BTW:single null-terminated string 意为 以单个/0结尾的字串
multiple null-delimited 意为 多个以/0分隔的。。。
通过该函数可实现在拷贝和移动的同时重命名。
原创粉丝点击