实现控制用户的权限。要求如下:
1、不同登陆用户使用自己对应的目录,以及里面的文件。(系统目录、其他用户的目录不允许访问)请指出具体的实现思路(40分)和需要的API函数(60分)!谢谢。
如果有代码我再追加100分。

解决方案 »

  1.   

    稍微关注一下,晚上回宿舍看看MSDN!!
      

  2.   

    SetFilePermission (Win32 API)来设置NTFS上的
    文件和目录的权限
    用法如下:
    BOOL SetFilePermission(LPCTSTR lpFileName, // address of string for filename
    SECURITY_INFORMATION SecurityInformation, // type of information to set
    PSECURITY_DESCRIPTOR pSecurityDescriptor // address of security descriptor
    ); SECURITY_INFORMATION用于指示下面一个参数的类型, 它可以取如下的值:
    OWNER_SECURITY_INFORMATION 
    文件和目录的所有者信息GROUP_SECURITY_INFORMATION 
    主组信息DACL_SECURITY_INFORMATION 
    自由的访问控制列表(ACL)信息SACL_SECURITY_INFORMATION 
    系统的访问控制列表(ACL)信息请您参考下列API函数和数据结构以获得设置权限的进一步的信息:
    ACL (DataStructure, Access Control List)
    Get/SetSecurityDescriptorDacl
    Get/SetSecurityDescriptorGroup
    Get/SetSecurityDescriptorOwner
    Get/SetSecurityDescriptorSacl
      

  3.   

    首先申明:这不是我写的(我还没这个本事:(),是从一本书摘下来的,如果要的话,我就贴出来!
    利用Windows外壳扩展保护文件夹 
    在Win32操作系统(包括Win9X、Windows NT、Windows 2000)不但有方便的图形用户(GUI)界面,微软还为windows用户界面保留了强大的可扩充性。其中对于Windows界面的操作环境(这里称为外壳Shell),微软提供了一种称为外壳扩展(Shell Extensions)的功能来实现文件系统操作的可编程性。UINT CopyCallback( 
    HWND hwnd, file://Handle/ of the parent window for displaying UI objects 
    UINT wFunc, file://Operation/ to perform. 
    UINT wFlags, file://Flags/ that control the operation 
    LPCSTR pszSrcFile, file://Pointer/ to the source file 
    DWORD dwSrcAttribs, file://Source/ file attributes 
    LPCSTR pszDestFile, file://Pointer/ to the destination file 
    DWORD dwDestAttribs file://Destination/ file attributes 
    );