当前位置:七道奇文章资讯安全技术网络技术
日期:2010-03-16 11:36:00  来源:本站整理

重启机械后自动删除文件[网络技术]

赞助商链接



  本文“重启机械后自动删除文件[网络技术]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

只需求一句话,便可以实现重启机械后自动删除文件.
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好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .