実現したいこと
NuGet Gallery | System.IO.FileSystem.AccessControl 5.0.0を 使用して、ディレクトリのアクセス権取得の処理をしたいが、NuGet Gallery | System.IO.FileSystem.AccessControl 5.0.0を NuGetマネージャでインストールしたのですが、インストール後、どのようにしてソースコードに組み込だら
良いので使用か、使用方法を教えてください。
発生している問題・分からないこと
NuGetで「System.IO.FileSystem.AccessControl 5.0.0」をインストールしたが
その先、VC#で、どのようにして「フォルダのアクセス権限」取得し、変更するのかが
教えてください。
以下のコードでFileSystemが名前空間System.IOには含まれるませんと表示されてしまいます。
System.IO.FileSystem.GetAccessControl(currentDirectory_work);
System.IO.FileSystem.SetAccessControl(currentDirectory_work, security);
該当のソースコード
FileSystemAccessRule rule = new FileSystemAccessRule( new NTAccount("everyone"), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow); DirectorySecurity security = System.IO.FileSystem.GetAccessControl(currentDirectory_work); security.SetAccessRule(rule); System.IO.FileSystem.SetAccessControl(currentDirectory_work, security);
試したこと・調べたこと
上記の詳細・結果
NuGet Gallery | System.IO.FileSystem.AccessControl 5.0.0を使用すると取得でき、変更もできる
と記載があったが、そのあとの記載がなかったので、インストール後の手順を知りたい。
補足
特になし
0 コメント