SetFileAttributes这个函数是做什么用的?

tony5566 2008-12-22 09:15:22
rt
...全文
474 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuehaiyang 2008-12-23
  • 打赏
  • 举报
回复
api函数
黑白赵 2008-12-23
  • 打赏
  • 举报
回复
设置文件属性的
mfwzhou 2008-12-23
  • 打赏
  • 举报
回复
一般的函数看一下帮助就可以了!
如果用F1找不到就一定是Windows SDK 那里面一定有。
wwwzxl 2008-12-23
  • 打赏
  • 举报
回复
楼上都对
zhao_yong 2008-12-23
  • 打赏
  • 举报
回复
設置文件屬性,如只讀,系統文件,隱藏等。
starluck 2008-12-22
  • 打赏
  • 举报
回复


SetFileAttributes('c:\1.txt',FILE_ATTRIBUTE_READONLY); //設置 1.txt 只讀


Attribute Meaning
FILE_ATTRIBUTE_ARCHIVE A file or directory that is an archive file or a directory.
Applications use this attribute to mark files for backup or removal.

FILE_ATTRIBUTE_HIDDEN The file or directory is hidden. It is not included in an ordinary directory listing.
FILE_ATTRIBUTE_NORMAL A file or directory that does not have other attributes set.
This attribute is valid only when used alone.

FILE_ATTRIBUTE_NOT_CONTENT_INDEXED The file or directory is not be indexed by the content indexing service.
FILE_ATTRIBUTE_OFFLINE The data of a file or directory is not available immediately.
This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is the hierarchical storage management software. Applications should not arbitrarily change this attribute.

FILE_ATTRIBUTE_READONLY A file or directory that is read-only.
For a file, applications can read the file, but cannot write to it or delete it.

For a directory, applications cannot delete it.

FILE_ATTRIBUTE_SYSTEM A file or directory that the operating system uses a part of, or uses exclusively.
FILE_ATTRIBUTE_TEMPORARY A file or directory that is being used for temporary storage.
File systems avoid writing data back to mass storage if sufficient cache memory is available, because typically, an application deletes a temporary file after the handle is closed. In that scenario, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed.


byteh 2008-12-22
  • 打赏
  • 举报
回复
设置文件的属性,比如【只读】【隐藏】等等.

菜单help->windows SDK,输入SetFileAttributes
The SetFileAttributes function sets a file's attributes.

BOOL SetFileAttributes(

LPCTSTR lpFileName, // address of filename
DWORD dwFileAttributes // address of attributes to set
);
de410 2008-12-22
  • 打赏
  • 举报
回复
设置文件属性的~~
僵哥 2008-12-22
  • 打赏
  • 举报
回复
设置文件的属性,比如【只读】【隐藏】等等.

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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