请问文件夹如何加密并形成文件?

sjd163 2004-09-18 02:52:03
请问文件夹如何加密并形成文件?
...全文
305 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
无聊客 2004-09-19
  • 打赏
  • 举报
回复
可以自己定义一个格式文件,把文件通过某种加密以后打进格式文件里,并且把文件夹和文件路径作为结构信息同时打进格式文件,解密时再按相反顺序解开.
wfhlxl 2004-09-18
  • 打赏
  • 举报
回复
有一冲办法,但只能防菜鸟,不能放高手,想要吗?
tovy 2004-09-18
  • 打赏
  • 举报
回复
枚举所有的文件以及子文件夹中的所有文件,按自己定义的结构,将所有的文件联接到一个文件中,再对这个文件加密和压缩,
解密时按自己的结构,再分开来,

以上是最简单的方式。
yinzhaohui 2004-09-18
  • 打赏
  • 举报
回复
就是使用一般的压缩软件的库,如zip的在压缩的时候就要求你输入密码作为打开该压缩文件依据,你在网上找找应当很多的
sjd163 2004-09-18
  • 打赏
  • 举报
回复
那API
过于简单吧。怎么能加密文件夹呢?
oyljerry 2004-09-18
  • 打赏
  • 举报
回复
windows提供了加密的API

EncryptFile
The EncryptFile function encrypts a file or directory.
All data streams in a file are encrypted. All new files
created in an encrypted directory are encrypted.

BOOL EncryptFile(
LPCTSTR lpFileName // file name
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that specifies
the name of the file or directory to encrypt.
The caller must have FILE_READ_DATA, FILE_WRITE_DATA,
FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES, and
SYNCHRONIZE access to the file.

Return Values
If the function succeeds, the return value is nonzero.


If the function fails, the return value is zero. To get
extended error information, call GetLastError.

Remarks
The EncryptFile function requires exclusive access to
the file being encrypted, and will fail if another
process is using the file.

If the file is already encrypted, EncryptFile simply
returns a nonzero value, which indicates success. If
the file is compressed, EncryptFile will decompress
the file before encrypting it.

To decrypt an encrypted file, use the DecryptFile
function.

Requirements
Windows NT/2000: Requires Windows 2000 or later.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on
Windows 2000.
Kudeet 2004-09-18
  • 打赏
  • 举报
回复
Crypt API
http://www.vckbase.com/document/listdoc.asp?sclsid=109
http://freehost11.websamba.com/KernelDesign/html/mydoc.htm

或者你用压缩什么的,同时加密
memory_xj 2004-09-18
  • 打赏
  • 举报
回复
网上有很多这样的东东,不要费心自己编了吧?
狂放之歌 2004-09-18
  • 打赏
  • 举报
回复
可能需要用到Shell编程
CardManager 2004-09-18
  • 打赏
  • 举报
回复
压缩文件就是其中一种
XmagicX 2004-09-18
  • 打赏
  • 举报
回复
不晓得,帮up

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧