2017-01-11 10 views
1

.Net 4.0クラスライブラリを.Net Core 1.1に移植し、.NetコアCLRのファイルセキュリティとアクセス許可の非常に制限の問題を抱えていました。 ファイルへのアクセス制御アクセス権を以下のように設定しようとしていましたが、FileInfoにはSetAccessControlまたはGetAccessControlがもうないようです。.Netコアでのファイルセキュリティのサポート

// Get a FileSecurity object that represents the 
    // current security settings. 
    FileSecurity fSecurity = File.GetAccessControl(fileName); 

    // Add the FileSystemAccessRule to the security settings. 
    fSecurity.AddAccessRule(new FileSystemAccessRule(account, 
     rights, controlType)); 

    // Set the new access settings. 
    File.SetAccessControl(fileName, fSecurity); 

目的は、ファイルの現在の所有者に実行権限を追加することです。どんな助けも高く評価されます。

答えて

関連する問題