0

我想编写一个程序,其中任何用户都无法访问文件夹。我将它的属性编号设置为 7,因此它变成了隐藏的、系统文件和只读的。但是任何用户都可以访问该文件夹。

我想要一个代码,其中出现一个消息框,说明在打开时拒绝访问。希望任何人都可以帮助我。

提前致谢

4

1 回答 1

0

你可以做到这一点ICACLS,在你的代码中运行它使用System.Diagnostics.Process.Start

' Your path here
Dim path As String = "X:\Path\Follows\Here.x"
Dim cmd As String = "icacls " & path & " /deny *S-1-1-0:(OI)(CI)(W,D,X)"
' You can also just use Process.Start even without "Imports System.Diagnostics"
System.Diagnostics.Process.Start(cmd)
于 2018-10-25T11:59:22.470 回答