重启机械后自动删除文件[网络技术]
本文“重启机械后自动删除文件[网络技术]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
只需求一句话,便可以实现重启机械后自动删除文件.
MoveFileExA(FileName,0,MOVEFILE_DELAY_UNTIL_REBOOT);
下面来自MSDN.
The MoveFileEx function moves an existing file or directory.
The MoveFileWithProgress function is equivalent to the MoveFileEx function, except that MoveFileWithProgress allows you to provide a callback function that receives progress notifications.
BOOL MoveFileEx( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, DWORD dwFlags);
Parameters
lpExistingFileName
[in] Pointer to a null-terminated string that names an existing file or directory on the local computer.
If dwFlags specifies MOVEFILE_DELAY_UNTIL_REBOOT, the file cannot exist on a remote share because delayed operations are performed before the network is available.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File
Windows 2000: If you prepend the filename with "\\?", you cannot also specify the MOVEFILE_DELAY_UNTIL_REBOOT flag for dwFlags.
lpNewFileName
[in] Pointer to a null-terminated string that specifies the new name of lpExistingFileName on the local computer.
When moving a file, the destination can be on a different file system or volume. If the destination is on another drive, you must set the MOVEFILE_COPY_ALLOWED flag in dwFlags.
When moving a directory, the destination must be on the same drive.
If dwFlags specifies MOVEFILE_DELAY_UNTIL_REBOOT and lpNewFileName is NULL, MoveFileEx registers the lpExistingFileName file to be deleted when the system restarts. If lpExistingFileName refers to a directory, the system removes the directory at restart only if the directory is empty.
dwFlags
[in] This parameter can be one or more of the following values.
以上是“重启机械后自动删除文件[网络技术]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |
- ·上一篇文章:制作属于自己的桌面搜索引擎
- ·下一篇文章:网银加密本领需知
- ·中查找“重启机械后自动删除文件”更多相关内容
- ·中查找“重启机械后自动删除文件”更多相关内容