GCC -FPIC опция

Вам нужно использовать пространство имен Security.

См. этот ответ SO.

Из ответов:

FileIOPermission writePermission = new FileIOPermission(FileIOPermissionAccess.Write, filename);
if(!SecurityManager.IsGranted(writePermission))
{
  //No permission. 
  //Either throw an exception so this can be handled by a calling function
  //or inform the user that they do not have permission to write to the folder and return.
}

Обновление: (следующие комментарии)

FileIOPermission касается политик безопасности, а не прав на файловую систему, поэтому вам нужно использовать DirectoryInfo.GetAccessControl .

381
задан Hauke Rehfeld 25 April 2016 в 18:41
поделиться