liqiqi
驱动牛犊
驱动牛犊
  • 注册日期2004-04-10
  • 最后登录2004-05-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值1点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2830回复:6

怎样加密文件夹

楼主#
更多 发布于:2004-04-10 17:00
请帮忙
moonYut
驱动小牛
驱动小牛
  • 注册日期2004-03-09
  • 最后登录2006-12-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望138点
  • 贡献值17点
  • 好评度117点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-04-10 21:01
在有个API函数LockFile();
  
  Platform SDK: Storage
LockFile

The LockFile function locks the specified file for exclusive access by the calling process using the specified file handle.

To specify additional options, use the LockFileEx function.


BOOL LockFile(
  HANDLE hFile,
  DWORD dwFileOffsetLow,
  DWORD dwFileOffsetHigh,
  DWORD nNumberOfBytesToLockLow,
  DWORD nNumberOfBytesToLockHigh
);

Parameters
hFile
[in] Handle to the file with a region to be locked. The file handle must have been created with the GENERIC_READ or GENERIC_WRITE access right. For more information, see File Security and Access Rights.
dwFileOffsetLow
[in] Low-order word of the starting byte offset in the file where the lock should begin.
dwFileOffsetHigh
[in] High-order word of the starting byte offset in the file where the lock should begin.

Windows Me/98/95:  dwFileOffsetHigh must be 0, the sign extension of the value of dwFileOffsetLow. Any other value will be rejected.


nNumberOfBytesToLockLow
[in] Low-order word of the length of the byte range to be locked.
nNumberOfBytesToLockHigh
[in] High-order word of the length of the byte range to be locked.
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
Locking a region of a file gives the threads of the locking process exclusive access to the specified region using this file handle. If the file handle is inherited by a process created by the locking process, the child process is not granted access to the locked region.

Locking a region of a file does not prevent reading from a mapped file view.

You can lock bytes that are beyond the end of the current file. This is useful to coordinate adding records to the end of a file.

Locks may not overlap an existing locked region of the file.

If LockFile cannot lock a region of a file, it returns zero immediately. It does not block. To issue a file lock request that will block until the lock is acquired, use LockFileEx without LOCKFILE_FAIL_IMMEDIATELY.

If a process terminates with a portion of a file locked or closes a file that has outstanding locks, the locks are unlocked by the operating system. However, the time it takes for the operating system to unlock these locks depends upon available system resources. Therefore, it is recommended that your process explicitly unlock all files it has locked when it terminates. If this is not done, access to these files may be denied if the operating system has not yet unlocked them.

The UnlockFile function unlocks a file region locked by LockFile.

Example Code
For an example, see Appending One File to Another File.

Requirements
Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.


See Also
File Management Functions, CreateFile, LockFileEx, UnlockFile

Platform SDK Release: February 2003  What did you think of this topic?
  Order a Platform SDK CD

 

Requirements
Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.

See Also
File Management Functions, CreateFile, LockFileEx, UnlockFile
刚则折,柔恒存,柔羽胜刚强! 万法自然,无根无极!--太极
moonYut
驱动小牛
驱动小牛
  • 注册日期2004-03-09
  • 最后登录2006-12-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望138点
  • 贡献值17点
  • 好评度117点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-04-10 21:16
你看明白了吗
刚则折,柔恒存,柔羽胜刚强! 万法自然,无根无极!--太极
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
地板#
发布于:2004-04-12 08:58
locks the specified file for exclusive access by the calling process using the specified file handle.
你这个是加密文件夹吗?????
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
liqiqi
驱动牛犊
驱动牛犊
  • 注册日期2004-04-10
  • 最后登录2004-05-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值1点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-04-12 22:00
你为什么要骗我,这是个文件加密的
moonYut
驱动小牛
驱动小牛
  • 注册日期2004-03-09
  • 最后登录2006-12-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望138点
  • 贡献值17点
  • 好评度117点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2004-04-12 22:15
是我老师告诉我的,我也不没用过,我今天仔细看了,不对,真是对不起了
刚则折,柔恒存,柔羽胜刚强! 万法自然,无根无极!--太极
walkonthesky
驱动中牛
驱动中牛
  • 注册日期2003-11-26
  • 最后登录2012-11-06
  • 粉丝0
  • 关注0
  • 积分1分
  • 威望20点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2004-04-14 14:22
加密文件夹的MS有EFS

仔细看里面的资料
很清楚
也很简单
[img]http://www.driverdevelop.com/forum/upload/walkonthesky/2004-07-08_2004-07-07_b847.gif[/img]
游客

返回顶部