开发者

.NET How to Stop a user from deleting the file?

开发者_如何学运维

I got this exam question "How to Stop a user from deleting the file?" I assume I should use some permission attribute, but which?


Use FileInfo and set its .IsReadOnly property.

        Dim fi As New FileInfo("c:\temp\temp.txt")
        fi.IsReadOnly = value


You cannot prevent a user with administrative rights from deleting a file. After all, he can overtake the file's ownership and change the permissions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜