只讀目錄, C:/attrib +A +S +H +R testdir C:/attrib testdir A SHR C:/testdir (1)VC6.0的執行結果: ***********test stat*********************** file [c:/testdir] exists! file [c:/testdir] is directory! file [c:/testdir] can be read! file [c:/
只讀目錄,
C:/>attrib +A +S +H +R testdir
C:/>attrib testdir
A SHR C:/testdir
(1)VC6.0的執行結果:
***********test stat***********************
file [c:/testdir] exists!
file [c:/testdir] is directory!
file [c:/testdir] can be read!
file [c:/testdir] can not be writed!
***********test access***********************
file [c:/testdir] exists!
file [c:/testdir] can not be writed!
file [c:/testdir] can be read!
(2)VS2005的執行結果
***********test stat***********************
file [c:/testdir] exists!
file [c:/testdir] is directory!
file [c:/testdir] can be read!
file [c:/testdir] can not be writed!
***********test access***********************
file [c:/testdir] exists!
file [c:/testdir] can be writed!
file [c:/testdir] can be read!
結論:在VS2005中,使用access判斷的只讀目錄卻有【寫入】的屬性。
有什么高招,歡迎解答。
建議,在VS2005中對文件、目錄進行權限校驗時,最好不要用access。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com